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

Script doesn't change clothes when pressed?

Asked by 9 years ago

I have created this script for a friend to where you have to be a certain rank to use the uniform. When I click on the button, it just makes my clothes black and doesn't assign the correct shirt/pants. What am I doing wrong?

local Player = game:GetService("Players").LocalPlayer
--Settings--
local rank = Player:GetRankInGroup(2561970)

local Uniform = {}
Uniform.Shirt = "http://www.roblox.com/STARBUCKS-HR-Uniform-item?id=239299022"
Uniform.Pants = "http://www.roblox.com/STARBUCKS-HR-Uniform-Shorts-item?id=239299059"
--function--
if rank >= 49 then
function AddUniform(P)
    local Character = P.Character
    repeat wait(0) until Character ~= nil
    for i,Object in next,Character:GetChildren() do
        if Object:IsA("Shirt") or Object:IsA("Pants") then
            Object:Destroy()
        end
    end
    local Shirt = Instance.new("Shirt",Character)
    Shirt.ShirtTemplate = Uniform.Shirt
    local Pants = Instance.new("Pants",Character)
    Pants.PantsTemplate = Uniform.Pants
end end
--GUIPart--
local Bin = script.Parent
if Bin:IsA("TextButton") or Bin:IsA("ImageButton") then
    Bin.MouseButton1Down:connect(function()
        AddUniform(Player)
    end)
end
1
Maybe subtract 1 from the ids? EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
2
Answered by
DVDKO 20
9 years ago

Try http://www.roblox.com/asset/?id=IDHERE?

1
This helped! Alpha_Toon 57 — 9y
Ad

Answer this question