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

How do I make a button to make a player invisible? [closed]

Asked by 6 years ago
Edited 6 years ago

I went to StarterGui and added a ScreenGui and then a TextButton.. but idk the script for when you click the button, it turns the player invisible. Can someone please help?

0
You need a script from you for us to fix if you want us to do anything. We won't just do the scripting for you. RobloxDeveloperJay 3 — 6y
0
This is what I tried: local Button = script.Parent local Frame = Button.Parent.Frame Button.MouseButton1Down:Connect(function() Frame.Visible = false end) local Button = script.Parent.MouseButton1Click:Connect(function() local Player = script.Parent Button.LocalPlayer.Visible = false end) NnIgHtMaRe0 0 — 6y
0
Last post people were telling me I didnt need help because I put the scripts I tried in the post and they said since I knew about scripting I didnt need help :/ NnIgHtMaRe0 0 — 6y

Closed as Not Constructive by User#19524 and Zafirua

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Put a Local Script inside the Text Button with the following code:

local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
        char = player.Character
    char.Head.Transparency = 1
    char.Torso.Transparency = 1
    char["Left Arm"].Transparency = 1
    char["Left Leg"].Transparency = 1
    char["Right Arm"].Transparency = 1
    char["Right Leg"].Transparency = 1
    char.Head.face.Transparency = 1
    for i,v in pairs(char:GetChildren()) do  -- This is to go through things like hair, wings, etc.
        if v.ClassName == "Accessory" then
            v.Handle.Transparency = 1
        end
    end
end)

That code should work I think. If this helps, be sure to mark me as an answer. It would've been better if you'd shown us some coding in your question though.

Ad