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

Could someone help me convert a script so it can work on a GUI text button?

Asked by
ghxstlvty 133
4 years ago

This is my old script-

pnts = script.Pants
shirt = script.Shirt

function onClicked(playerWhoClicked)

end
function GiveClothes(character)
if not character:findFirstChild("Shirt") then 
shirt:Clone().Parent = character
else character:findFirstChild("Shirt"):Destroy()
shirt:Clone().Parent = character
end

if not character:findFirstChild("Pants") then 
pnts:Clone().Parent = character
else character:findFirstChild("Pants"):Destroy()
pnts:Clone().Parent = character
end
end

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(1.12)
local plr = game.Players:findFirstChild(char.Name)
print(char.Name)

local groupid = 0 -- Id of your group

local plr =  game.Players:GetPlayerFromCharacter(part.Parent)

if plr then

if plr:IsInGroup(groupid) then

if plr:GetRoleInGroup(groupId) >= 50 
then GiveClothes(char)
end
end 
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

I now need a gui to pick your uniform from and want to convert this script so that it works with a text button. Could someone help me?

0
You'd be better off asking specifically what you need help with. Also, the lack of indention makes that very hard to read. davidgingerich 603 — 4y

Answer this question