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

How should I use the function value changed?

local player = game.Players.LocalPlayer
local level = player.leaderstats1.Level
if level.valuechanged then
	game.Workspace.guipart.Size = Vector3.new(999999,9999999,999999)
end

1 answer

✓ Accepted answer

Value objects have a .Changed event, which fires when it's value changes. Your code can look like this with it:

local player = game.Players.LocalPlayer
local level = player.leaderstats1.Level

Level.Changed:Connect(function()
	--Code that runs when the value changes would go here
end)

1 comment

0

Thx

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