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

There seems to be an error somewhere but im not sure where?

Filipalla helped me test my game but he found an error and not sure how to fix it.

	script.Value.Changed:connect(function()
	if script.Value.Value > 100 then
		script.Value.Value = 100
	end
	end)
while true do
	wait(0.05)
	game.Players.LocalPlayer.PlayerGui.ScreenGui.MTC.Text = script.Value.Value
end

2 answers

✓ Accepted answer

Why do you have script.Value? there is not a value property of the script.

If you have a variable named 'script', change it because you cannot use key words as variable names.

I also notice you used the Changed event on an property, instead of the instance.

local value = game.Workspace.Value -- where ever the value is

value.Changed:connect(function() -- not value.Value.Changed
	if value.Value > 100 then
		value.Value = 100
	end
end)

while true do
	wait(0.05)
	game.Players.LocalPlayer.ScreenGui.MTC.Text = tostring(value.Value)
end

Also make sure you're running this in a local script.

1 comment

0

Also, all tostring does it turn a number into a word(string).

"script.Value.Value"

Something is wrong here, you can have a value of a value

1 comment

0

scripts dont have a Value either

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