✓ Accepted answer
It's not working because you are setting a value with one equals sign. Using 2 equals signs waits for a value, so to fix you would do
UPDATED:
This is in a local script inside of the starter gui
local player = game.Players.LocalPlayer
while true do
for _,object in pairs(player.leaderstats:GetChildren()) do
wait()
if object.Value == 1 then
workspace.toto.TowerPortal.towername.BrickColor = BrickColor.new("Sea green")
end
end
end
leaderstats script (If you already have one don't write this)
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Green = Instance.new("IntValue")
Green.Name = "Green"
Green.Parent = leaderstats
end)
This is probably really inefficient because im using some old methods but it works anyway :/
8 comments
Thanks! I'll try that!
I tried and it says Players.Stoutscientist.PlayerGui.LocalScript:1: Incomplete statement: expected assignment or a function call
Also I made sure stats is in the local player so it isn't that
Try adding a wait().
ok i'm trying to see what I did wrong
I re did mine but its probably bad and outdated but it still works!
THANK YOU SO MUCH IT WORKED
np