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

How would I make a permission table for this?

Asked by 10 years ago

When the script runs, it should make the players in the list run only for them. I changed the plr = Game:service'players'.LocalPlayer to IntellectualBeing where it says LocalPlayer it only makes me mini, and none of the commands work or anything.

Then I wondered if adding a permission script would make it work.

Like permission = {"IntellectualBeing"} The problem is, how would I connect it?

Here is the first part of my script. I only pasted the half I needed because the whole script is like 1k lines...

local ran,err = ypcall(function()
plr = game:service'Players'.LocalPlayer
char = plr.Character
mouse = plr:GetMouse()
humanoid = char:findFirstChild("Humanoid")
torso = char:findFirstChild("Torso")
head = char.Head
ra = char:findFirstChild("Right Arm")
la = char:findFirstChild("Left Arm")
rl = char:findFirstChild("Right Leg")
ll = char:findFirstChild("Left Leg")
rs = torso:findFirstChild("Right Shoulder")
ls = torso:findFirstChild("Left Shoulder")
rh = torso:findFirstChild("Right Hip")
lh = torso:findFirstChild("Left Hip")
neck = torso:findFirstChild("Neck")
rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
anim = char:findFirstChild("Animate")
rootpart = char:findFirstChild("HumanoidRootPart")
camera = workspace.CurrentCamera
if anim then
anim:Destroy()
end

1 answer

Log in to vote
0
Answered by
Dummiez 360 Moderation Voter
10 years ago

One way of doing this is by via a function and a loop returning whether name matches string in table. Not tested so see if it works.

admins = {"IntellectualBeing", "Player1"}

function checkPlr(name)
    for i = 1, #admins do if (admins[i] == name) then return true 
    else return false 
    end end
end

local ran,err = ypcall(function()
if checkPlr(game:service'Players'.LocalPlayer:GetFullName()) then -- Found player? (GetFullName or .Name)?
plr = game:service'Players'.LocalPlayer
char = plr.Character
mouse = plr:GetMouse()
humanoid = char:findFirstChild("Humanoid")
torso = char:findFirstChild("Torso")
head = char.Head
ra = char:findFirstChild("Right Arm")
la = char:findFirstChild("Left Arm")
rl = char:findFirstChild("Right Leg")
ll = char:findFirstChild("Left Leg")
rs = torso:findFirstChild("Right Shoulder")
ls = torso:findFirstChild("Left Shoulder")
rh = torso:findFirstChild("Right Hip")
lh = torso:findFirstChild("Left Hip")
neck = torso:findFirstChild("Neck")
rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
anim = char:findFirstChild("Animate")
rootpart = char:findFirstChild("HumanoidRootPart")
camera = workspace.CurrentCamera
if anim then
anim:Destroy()
end
end
Ad

Answer this question