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

How in the world do I make a script that hides hats?

Asked by 4 years ago

So, my main issue is that I have no freaking clue on how to make a script where a GUI pops up on your screen.

You click the GUI, and it equips your helmet but hides your hair. No clue how to do that in the slightest. Which is why I'm here, please respond, and have a nice day.

0
Check the wiki articles about text/image buttons and accesories. You will also need to use remote events, so maybe give the article covering that topic a look aswell. Le_Teapots 913 — 4y
0
You can set the MeshId of the Mesh ID to nothing to "remove" the hat when the button is clicked. Daemonophobiaa 37 — 4y
0
Or just remove the hat using :Destroy() or :Remove() Daemonophobiaa 37 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Set the "handle" or parts in the hat to "1" ?

Ad
Log in to vote
0
Answered by
Optikk 499 Donator Moderation Voter
4 years ago
Edited 4 years ago

If you want to hide the hats, you'll want to set the transparency of their handles to 1. Otherwise, you can call destroy on them. It's quite easy. On the server, you'll run a loop that deletes any accessory on the character, something like this:

for _, v in pairs(character:GetChildren()) do
    if v:IsA('Accessory') then
        v:Destroy() -- or v.Handle.Transparency = 1
    end
end

Now for the button clicking. You may want to read up on remote events for this one. Assuming you know how to listen to button clicks, just call FireServer on the remote and handle it by removing the accessories from the player that clicked the button.

some things to read:

https://developer.roblox.com/en-us/api-reference/class/RemoteEvent https://developer.roblox.com/en-us/api-reference/class/GuiButton

Answer this question