#My code not working for shop :/
13 messages · Page 1 of 1 (latest)
so
i ave shop gui
with a button called Stick
and leaderstats with value called Tails
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local Tails = Instance.new("IntValue", leaderstats)
Tails.Name = "Tails"
Tails.Value = 5
this is my code in serverscriptservice
and
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Tool = ReplicatedStorage.Tools:WaitforChild("Stick")
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if plr.leaderstats.Tails.Value >= 1 then
print("nice")
local ClonedTool = Tool:Clone()
ClonedTool.Parent = plr.Backpack
else
print("You dont have the requirements")
end
end)
this is my code in local script on the button
ive been tryna figure it out for like a hour 😭
typo in wait for child but i fixed it
and it still dont work
** You are now Level 1! **