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

How to match Variables with Players?

Asked by 10 years ago

In the script below, how would you be able to match the house ID in the variables to the actual player?

I want the player to be matched with their house ID, and then I want local id to change the that players number, for example, wattlemanHouse is 1842, I want local id to come up 1842 and wattleman be linked with wattlemanHouse.

--Made by wattleman

--------------------------------------------------------
---------------Variables | Edit Below-------------------
--------------------------------------------------------

names = {"wattleman","Player1","SheriffOhiostatefan"}

wattlemanHouse = 1842
Player1House = 1842
SheriffOhiostatefanHouse = 0801

--------------------------------------------------------
------------DO NOT EDIT BELOW THIS LINE!----------------
--------------------------------------------------------
HC2 = script.Parent
NoHouse2 = HC2.NoHouse
controls = HC2.moreOptions


game.Players.PlayerAdded:connect(function(pName)
    for i,v in pairs(names) do
        if pName.Name == v then
            local id = 0
                NoHouse2.Visible = false
                controls.Visible = true
        else
            NoHouse2.Visible = true
            controls.Visible = false
        end
    end
end)



1
I have no idea what you mean. Perci1 4988 — 10y
0
I need it to find you name, (pName) and find the variable with your name in it, with the word house at the end. wattleman 90 — 10y
1
Still don't understand. Why would you need to find a specific variable? After all, you created them. On top of that, you would never be able to create a variable for every person on roblox's username. Perci1 4988 — 10y
0
It wont be for ever person on ROBLOX. wattleman 90 — 10y

Answer this question