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

How should I use the function value changed?

Asked by 3 years ago
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

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

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)
0
Thx FluffySheep46209 369 — 3y
Ad

Answer this question