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

Is this correct?

Asked by 10 years ago

I've asked this question twice, I got 2 different answers, Yes and No. Is there something wrong in my script?

permission = {"fahmisack123","A380Guy","ismailtheboss","chrysalisever","backflip123456","HeroFrancis30","HeroicFabian"}

texture = "www.roblox.com/Gem-Tycoon-VIP-Admin-shirt-item?id=129892951"

function checkOkToLetIn(name) 
    for i = 1,#permission do 
        if (string.upper(name) == string.upper(permission[i])) then return true end 
    end 
    return false 
end 

local Door = script.Parent

function onTouched(hit) 
    print("Door Hit") 
    local human = hit.Parent:findFirstChild("Humanoid")
    if (human ~= nil ) then 
        if human.Parent.Torso.roblox.Texture == texture or human.leaderstats.Admins >= 1 then -- I also need help in this line
--CONTENT CENSORED
        elseif (checkOkToLetIn(human.Parent.Name)) then 
--CONTENT CENSORED
            wait(3)
            Door.CanCollide = true 
            Door.Transparency = 0 
        end 
    end 
end 

script.Parent.Touched:connect(onTouched)

EXTRA QUESTION Does Roblox Lua use BIDMAS/BODMAS because then I wouldn't get confused if I calculate 1+1*47+3 which is 51 using BIDMAS/BODMAS

0
Changed my answer, pretty sure it'll work. hudzell 238 — 10y

1 answer

Log in to vote
0
Answered by
hudzell 238 Moderation Voter
10 years ago
permission = {"fahmisack123","A380Guy","ismailtheboss","chrysalisever","backflip123456","HeroFrancis30","HeroicFabian"}

texture = "www.roblox.com/Gem-Tycoon-VIP-Admin-shirt-item?id=129892951"

function checkOkToLetIn(name) 
    for i = 1,#permission do 
        if (string.upper(name) == string.upper(permission[i])) then return true end 
    end 
    return false 
end 

local Door = script.Parent

function onTouched(hit) 
    print("Door Hit") 
    local human = hit.Parent:findFirstChild("Humanoid")
    if human ~= nil then --Removed Parentheses
        if human.Parent.Torso.roblox.Texture == texture or human.leaderstats.Admins > 1 then -- Changed from >= to >
        elseif checkOkToLetIn(human.Parent.Name) then --Removed Parentheses
            Door.CanCollide = false
            wait(3)
            Door.CanCollide = true 
            Door.Transparency = 0 
        end 
    end 
end 

script.Parent.Touched:connect(onTouched)
0
I know. I just forgot to copy that part fahmisack123 385 — 10y
0
If you do not give me the whole script (Ctrl + A) I cannot help you, sorry. hudzell 238 — 10y
0
Bracket's don't make a difference do they? I got the full script for you fahmisack123 385 — 10y
0
Yes they do make a difference. hudzell 238 — 10y
View all comments (2 more)
0
In line 18, did I correctly find the leaderstats of a person? Because the output displayed an error (Forgot) and then I did Parent.Parent and the output displayed that leaderstats is not part of Model. What model? and how can I fix this? fahmisack123 385 — 10y
0
Also, for line 18, can I do this: if human.Parent.Torso.roblox.Texture == texture or game:GetService("GamePassService"):PlayerHasPass(human, 157283455) then end fahmisack123 385 — 10y
Ad

Answer this question