I dont know how to fix this but i know it is in line 5
local cV = Instance.new("IntValue") cV.Name = "clickedValue" cV.Parent = plr.PlayerGui cV.Value = 1 end) script.Parent.MouseClick:connect(function(plr) local pCV = plr:FindFirstChild("clickedValue") local pLS = plr:FindFirstChild("leaderstats") local pP = pLS:FindFirstChild("Points") local price = 10 if pP < price then pCV = pCV + 1 end end)
Remove the end) at the top of you're script you only need those after you use an anonymous function also plr isn't defined so you need to do something like plr = game.Players.LocalPlayer make sure you put the script in a local script. The code should look like this
I would help more but i am not sure how you have everything set up so this is as much as i can do
-- you're script i just indented this local cV = Instance.new("IntValue") cV.Name = "clickedValue" cV.Parent = plr.PlayerGui cV.Value = 1 end) script.Parent.MouseClick:connect(function(plr) local pCV = plr:FindFirstChild("clickedValue") local pLS = plr:FindFirstChild("leaderstats") local pP = pLS:FindFirstChild("Points") local price = 10 if pP < price then pCV = pCV + 1 end end)
--edited script local cV = Instance.new("IntValue") cV.Name = "clickedValue" plr = game.Players.LocalPlayer cV.Parent = plr.PlayerGui cV.Value = 1 script.Parent.MouseClick:connect(function(plr) local pCV = plr:FindFirstChild("clickedValue") local pLS = plr:FindFirstChild("leaderstats") local pP = pLS:FindFirstChild("Points") local price = 10 if pP < price then pCV = pCV + 1 end end)
Remove the end)
You didn't start a function so it doesn't need an end. This would do it:
local cV = Instance.new("IntValue") cV.Name = "clickedValue" cV.Parent = plr.PlayerGui cV.Value = 1 script.Parent.MouseClick:connect(function(plr) local pCV = plr:FindFirstChild("clickedValue") local pLS = plr:FindFirstChild("leaderstats") local pP = pLS:FindFirstChild("Points") local price = 10 if pP < price then pCV = pCV + 1 end end)