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

I am trying to do a team changer. What did I do wrong?

Asked by 4 years ago
Edited by User#24403 4 years ago
local Lock1 = script.Parent.Frame.locks["Lock(MP)"]
local Locks = script.Parent.Frame.locks
local LockDev = script.Parent.Frame.locks.LockDev
local LockMarsh = script.Parent.Frame.locks.LockMarshel
local LockOfficer = script.Parent.Frame.locks.LockOfficer

if game.Players.LocalPlayer:GetRankInGroup(4937707)== "1" then
    Lock1:Destroy()
    print("Member is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "255" then
    Locks:Destroy()
    print("Owner/Marshel Is in")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "254" then
    Locks:Destroy()
    print("Marshel Is in")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "150" then
    Lock1:Destroy()
    LockDev:Destroy()
    print("Dev is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "54" then
    LockOfficer:Destroy()
    Lock1:Destroy()
    print("Officer is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "53" then
    LockOfficer:Destroy()
    Lock1:Destroy()
    print("Officer is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "52" then
    LockOfficer:Destroy()
    Lock1:Destroy()
    print("Officer is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "51" then
    LockOfficer:Destroy()
    Lock1:Destroy()
    print("Officer is here")
end
if game.Players.LocalPlayer:GetRankInGroup(4937707) == "50" then
    LockOfficer:Destroy()
    Lock1:Destroy()
    print("Officer is here")
end

as you can see here, locks suppose to cover the team changer buttons. I have developer role, the locks of developer won't destroy, also it doesn't print anything, any help???

0
:GetRankInGroup returns a number, a number, not a string representation of a number. Also instead of a bunch of messy control structures use dictionaries. An answer is coming right up User#24403 69 — 4y
0
Alright thank you.. I'll be waiting! fortesss7 40 — 4y
0
That thing only comes up once and thats it, try use "game.Players.Playadded" and then after that see if the player is in the group and if they are then make a variable saying local rank = player:GetRankInGroup(4937707) if rank == (whatever) then do whatever do this all in a server script WillBe_Stoped 71 — 4y
0
WillBe_Stoped: fortesss7 40 — 4y
View all comments (4 more)
0
Tried this : game.Players.PlayerAdded:Connect(function(player) local Rank = player:GetRoleInGroup(4937707) if Rank == (150) then print("test") end end) fortesss7 40 — 4y
0
waits.. fortesss7 40 — 4y
0
This script is badly optimized in my opinion but in theory it should work. Make sure the developer rank is the same as the rank number in the Group Admin SmartNode 383 — 4y
0
It is alright. I just putted the numbers in "1", suppose to be 1 not "1" fortesss7 40 — 4y

Answer this question