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

How do you make a clothes gate for group uniforms?

Asked by 5 years ago
Edited 5 years ago

So I am trying to make an invisible door that you can walk through, and once walked through it will select the right uniform based on your rank within the group and put it on you. I've tried various ways and nothing seems to be working. My Lua knowledge is very small so I don't even know if I am close or horribly wrong.

local GroupId = 4217419

game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Touched:Connect(function(hit)
    if plr:GetRankInGroup(GroupId) == 247 and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Shirt.ShirtTemplate = "rbxassetid://2165624791"
        hit.Parent.Pants.PantsTemplate = "rbxassetid://2165669286"
    elseif plr:GetRankInGroup(GroupId) == 248 and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Shirt.ShirtTemplate = "rbxassetid://2165624316"
        hit.Parent.Pants.PantsTemplate = "rbxassetid://2165669286"
    elseif plr:GetRankInGroup(GroupId) == 249 and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Shirt.ShirtTemplate = "rbxassetid://2165624316"
        hit.Parent.Pants.PantsTemplate = "rbxassetid://2165669286"
    elseif plr:GetRankInGroup(GroupId) == 250 and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Shirt.ShirtTemplate = "rbxassetid://2165632105"
        hit.Parent.Pants.PantsTemplate = "rbxassetid://2165673300"
    elseif plr:GetRankInGroup(GroupId) >= 251 and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Shirt.ShirtTemplate = "rbxassetid://2165667431"
        hit.Parent.Pants.PantsTemplate = "rbxassetid://2165669286"
     end
end)
0
Is the part that you are selecting CanCollide true? Also, is this a Script, not a LocalScript? And, Are there any errors? Just some thigns I need to know because your script looks okay KDarren12 705 — 5y
0
It's a Script, no errors and my part is CanCollide false I think if be able to walk through it is false then it's false, but the thing is when I walk through the block it doesn't show anything happening in the output view. xXxBroZillaxXx 7 — 5y
0
The ShirtTemplate and the PantsTemplate are both instde the Shirt? WoTrox 345 — 5y
0
I've changed it and still no errors and nothing showing up in the output view. I also edited my first post at the top of this page to the updated version it's what my script is right now. xXxBroZillaxXx 7 — 5y

Answer this question