Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

How to make a button save a players name ?

Asked by 5 years ago

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

1 answer

Log in to vote
0
Answered by 5 years ago

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.

Ad

Answer this question