✓ Accepted answer
There are some easy ways to do this
For Certain Commands Player Specific:
local Player_Accepted = "EasilyTech";
game.Players.PlayerAdded:connect (function(player)
player.Chatted:connect(function (msg)
if msg == "Material" and player.Name == Player_Accepted then
game.Workspace.BaseDoor.Material = Enum.Material.Plastic
game.Workspace.WallA.Material = Enum.Material.Plastic
game.Workspace.WallB.Material = Enum.Material.Plastic
game.Workspace.Walls.Material = Enum.Material.Plastic
elseif msg == "reset" then
player.Character:BreakJoints();
end
end)
end)
All Commands Player Specific:
local Player_Accepted = "EasilyTech";
game.Players.PlayerAdded:connect (function(player)
if player.Name == Player_Accepted then
player.Chatted:connect(function (msg)
if msg == "Material" then
game.Workspace.BaseDoor.Material = Enum.Material.Plastic
game.Workspace.WallA.Material = Enum.Material.Plastic
game.Workspace.WallB.Material = Enum.Material.Plastic
game.Workspace.Walls.Material = Enum.Material.Plastic
end
end)
end;
end)
These are just a few simple ways of doing this. ** Please note: This only works with the specified username. It won't work for them anymore if they change their name. **
I hope this helped. If it did please accept this as the answer so that others know that you have been helped and a solution has been found.
If it didn't help feel free to message me and ask whatever you need to. If you have other questions again feel free to message me and ask for help.
Thank you to TheAlphaStigma for reminding me to add this:
local Players_Accepted = {["EasilyTech"[ = true, ["YourFriendHere"] = true};
game.Players.PlayerAdded:connect (function(player)
if Players_Accepted[player.Name] then
player.Chatted:connect(function (msg)
if msg == "Material" then
game.Workspace.BaseDoor.Material = Enum.Material.Plastic
game.Workspace.WallA.Material = Enum.Material.Plastic
game.Workspace.WallB.Material = Enum.Material.Plastic
game.Workspace.Walls.Material = Enum.Material.Plastic
end
end)
end;
end)
This one will check if the player is in a table and should be allowed to chat based on a list of players.
5 comments
Another way, if you want multiple players to be able to use the command, is to use the table w/ brackets. "local tbl = {['Player1'] = true, ['Player2'] = true}" (Haven't scripted in months, so go easy on me.)
I was thinking of adding that but I didn't let me add it.
You forgot the brackets around the names lol.
shhhh
I was tired. xD