Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this working? Is it because there needs to be a function?

Ok so this script worked when I had an on level changed function above the Level.Value>1 Line but I want this script to check if a player is a certain level and then show the image above their head without an on level changed function

player = script.Parent.Parent.Parent.Parent
stats = player:WaitForChild("leaderstats")
Level = stats:WaitForChild("Coins")


if Level.Value > 1 then
script.Parent.Parent.Parent.Parent.Character.Head.Membership.Badge.Visible = true

end
end)

1 answer

✓ Accepted answer

Your script only runs one time; as soon as the server starts. A changed function would be best, but if you don't want to, you need some kind of loop with a wait.

Also you don't need that last "end)", and you should index "player".

player = script.Parent.Parent.Parent.Parent
stats = player:WaitForChild("leaderstats")
Level = stats:WaitForChild("Coins")

while wait(1) do
	if Level.Value > 1 then
		player.Character.Head.Membership.Badge.Visible = true
	end
end

1 comment

0

ily thank u

This discussion is preserved as it was. New answers, comments, and votes are closed.