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

Troubleshoot with my Textbutton?

songname=script.Parent.tostring(Text)
script.Parent.MouseButton1Click:connect(function()
	game.Workspace.SongVote.songname.Value=game.Workspace.SongVote.songname.Value+1
	script.Parent.Parent.Parent.Visible=false

end)

I tried adding a (tostring) but it doesnt work, and I really have no idea what to do here So if someone could tell me what to do to fix this, it would help a lot

Parent is a TextButton

1 comment

0

Please remember to format the code you post to make it easier to read. Select the code section of your post and click the Lua logo.

1 answer

✓ Accepted answer

You were using tostring incorrectly and you didn't need it anyway since Text is already a string. The problem was the way you were trying to index the song.

songname=script.Parent.Text
script.Parent.MouseButton1Click:connect(function() 	
	game.Workspace.SongVote[songname].Value=game.Workspace.SongVote[songname].Value+1 
	script.Parent.Parent.Parent.Visible=false
end)

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