-
What do you want to achieve?
What i want to do is when someone touchs a part it give a shirt and pants depending on his group rank -
What is the issue?
The script works fine, but the shirt does’nt apear. The url is not good somehow. -
What solutions have you tried so far?
–
Cloths for rank 20+
Shirt - 5046822178
Pants - 5046820092
Cloths for rank 20-
Shirt - 5046827173
Pants - 5046892936
emp_shirt = "rbxassetid://5046827173"
emp_pants = "rbxassetid://5046892936"
hr_shirt = "rbxassetid://5046822178"
hr_pants = "http://www.roblox.com/asset/?id=5046820092"
local border = script.Parent
function checkUni(char)
if char:WaitForChild("Shirt",1) and char:WaitForChild("Pants",1) then
return true
else
return false
end
end
border.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild"Humanoid"then
local ownCloths = checkUni(hit.Parent)
if ownCloths then
local shirt = hit.Parent:WaitForChild("Shirt",1)
local pants = hit.Parent:WaitForChild("Pants",1)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr:GetRankInGroup(6089525) >= 20 then
shirt.ShirtTemplate = "rbxassetid://5046822178"
pants.PantsTemplate = "rbxassetid://5046820092"
else
shirt.ShirtTemplate = "rbxassetid://5046827173"
pants.PantsTemplate = "rbxassetid://5046892936"
end
else
-- Delete Every Clothes
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
for _,v in pairs(hit.Parent:GetChildren()) do
if v:IsA("Shirt") or v:IsA("Pants") then
v:Destroy()
end
end
local newShirt = Instance.new("Shirt",hit.Parent)
local newPants = Instance.new("Pants",hit.Parent)
if plr:GetRankInGroup(6089525) >= 20 then
newShirt.ShirtTemplate = "rbxassetid://5046822178"
newPants.PantsTemplate = "rbxassetid://5046820092"
else
newShirt.ShirtTemplate = "rbxassetid://5046827173"
newPants.PantsTemplate = "rbxassetid://5046892936"
end
end
end
end)
Thanks for reading ![]()