I want to make a GUI for a voting system on my game on what i should add. Is there a way to make a script that logs a players name and saves it. So i can view it later
COMMUNITY QUESTION
How to make a button save a players name ?
1 answer
Sure, But I'm not going to spoon-feed you the whole GUI script. You still have to figure it by yourself, Here's the mechanic, this will do the work:
local pvote1 = {}
local pvote2 = {}
local pvote3 = {}
local function VoteFromPlayer(plr,vote) --Use RemoteFunction.
-- Remember to check if the player is already in the table.
if vote ==1 then
table.insert(pvote1,plr)
elseif vote==2 then
table.insert(pvote2,plr)
elseif vote==3 then
table.insert(pvote3,plr)
end
end
RemoteFunction.OnServerInvoke = VoteFromPlayer
Also. Add a line that will remove the player from the old tables, in-case they change their minds.
This discussion is preserved as it was. New answers, comments, and votes are closed.
