Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The end of my door script is giving me an error,what am I doing wrong?

Asked by 3 years ago

I made this leaderstats script: ``game.Players.PlayerAdded:Connect(function(player)

local leaderstats = Instance.new("Folder") 
leaderstats.Name = "leaderstats"


local Points = Instance.new("IntValue")
Points.Name = "Points"

end)``

the leaderboard script works but this one doesn't (im saying this because both are related)

game.Players.PlayerAdded:Connect(function(player) if player.leaderstats.Points.Value == 5 then script.Parent.Transparency = 0.5 script.Parent.CanCollide = false end)

it gives me this error 23:33:14.041 - Workspace.door1.Script:5: Expected identifier when parsing expression, got ')'

I was under the impression that all events end with "end)" so could someone tell me what im doing wrong?

0
ame.Players.PlayerAdded:Connect(function(player) if player.leaderstats.Points.Value == 5 then script.Parent.Transparency = 0.5 script.Parent.CanCollide = false end end) you are missing a second end for your conditional statement misha123 83 — 3y
0
Thank you! You fixed it but it now says leaderstats is not a valid of player but ill make a another post for that haha. mikechris333 10 — 3y

Answer this question