when the value "y" its value has been changed, it doesnt print "test". Why wont y.Changed work?
script:
local plr = game.Players.LocalPlayer
local pg = plr:WaitForChild("PlayerGui")
function gameo()
-- Objects
local Life = Instance.new("ScreenGui")
local onelife = Instance.new("ImageLabel")
local secondlife = Instance.new("ImageLabel")
local thirdlife = Instance.new("ImageLabel")
local lifecount = Instance.new("TextLabel")
local y = Instance.new("NumberValue")
-- Properties
Life.Name = "Life"
Life.Parent = game.StarterGui
y.Name = "count"
y.Parent = lifecount
onelife.Name = "onelife"
onelife.Parent = Life
onelife.BackgroundColor3 = Color3.new(1, 1, 1)
onelife.BackgroundTransparency = 1
onelife.Position = UDim2.new(0.551270008, 0, 0, 0)
onelife.Size = UDim2.new(0.0705550313, 0, 0.0990415365, 0)
onelife.Image = "rbxassetid://590924431"
secondlife.Name = "secondlife"
secondlife.Parent = Life
secondlife.BackgroundColor3 = Color3.new(1, 1, 1)
secondlife.BackgroundTransparency = 1
secondlife.Position = UDim2.new(0.621825039, 0, -0.00159744406, 0)
secondlife.Size = UDim2.new(0.0705550313, 0, 0.0990415365, 0)
secondlife.Image = "rbxassetid://590924431"
thirdlife.Name = "thirdlife"
thirdlife.Parent = Life
thirdlife.BackgroundColor3 = Color3.new(1, 1, 1)
thirdlife.BackgroundTransparency = 1
thirdlife.Position = UDim2.new(0.692380071, 0, -0.00159744406, 0)
thirdlife.Size = UDim2.new(0.0705550313, 0, 0.0990415365, 0)
thirdlife.Image = "rbxassetid://590924431"
lifecount.Name = "lifecount"
lifecount.Parent = Life
lifecount.BackgroundColor3 = Color3.new(1, 1, 1)
lifecount.BackgroundTransparency = 1
lifecount.Position = UDim2.new(0.762935102, 0, 0.00958466437, 0)
lifecount.Size = UDim2.new(0, 65, 0, 50)
lifecount.Font = Enum.Font.Arcade
lifecount.Text = "x3"
lifecount.TextColor3 = Color3.new(1, 1, 1)
lifecount.TextScaled = true
lifecount.TextSize = 14
lifecount.TextWrapped = true
y.Value = 3
lifecount.Text = y.Value
y.Changed:Connect(function()
print("Test")
end)
end
gameo()
thanks

5 comments
What causes the value to change, other than y.Value = 3? There's a chance that this won't fire the event
changing it thorough the explorer
Why are you using global function? You should be using local variables at all tjmes
really? everything works except that changed function
This looks like a Roblox issue if anything.