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

The value won't change but the text will?

--|| Variables ||--
local Vote2Button = script.Parent.butt
local Vote1Button = script.Parent.on
local Vote2Text = script.Parent.oof
local Vote1Text = script.Parent.poof

--|| Script ||--
Vote1Text.Value.Changed:Connect(function()
	Vote1Text.Text = Vote1Text.Value.Value
end)

Vote2Text.Value.Changed:Connect(function()
	Vote2Text.Text = Vote2Text.Value.Value
end)

Vote1Button.MouseButton1Click:Connect(function()
	Vote1Text.Text = Vote1Text.Value.Value+1
end)

Vote2Button.MouseButton1Click:Connect(function()
	Vote2Text.Text = Vote2Text.Value.Value+1
end)

So this script is supposed to be a voting system, the Text of "oof" and "poof" would change but their values wouldn't because of this problem the Text can't add anymore it stays at 1.

1 answer

✓ Accepted answer

You are just Setting the Text to the Value + 1. I would do this:

--|| Variables ||--
local Vote2Button = script.Parent.butt
local Vote1Button = script.Parent.on
local Vote2Text = script.Parent.oof
local Vote1Text = script.Parent.poof

--|| Script ||--
Vote1Text.Value.Changed:Connect(function()
    Vote1Text.Text = Vote1Text.Value.Value
end)

Vote2Text.Value.Changed:Connect(function()
    Vote2Text.Text = Vote2Text.Value.Value
end)

Vote1Button.MouseButton1Click:Connect(function()
    Vote1Text.Value.Value = Vote1Text.Value.Value+1
    Vote1Text.Text = Vote1Text.Value.Value
end)

Vote2Button.MouseButton1Click:Connect(function()
     Vote2Text.Value.Value = Vote2Text.Value.Value+1
    Vote2Text.Text = Vote2Text.Value.Value
end)

1 comment

0

Ah okay, thanks.

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