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

need help on this GUI script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
button = script.Parent
function removeGUI()
    wait(1)
    script.Parent.Parent.Visible = false  -- this is the part works fine
    wait()
    gun = game.Lighting.LinkedPaintballGun:Clone()
    gun.Parent = game.Players. -- this is the part that i am stuck on, i know what to do but there sint a backpack where i can put the gun in
    end
button.MouseButton1Click:connect(removeGUI)



1 answer

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago

Ok let's say this was a TextButton part of a Frame.

Like this

ScreenGui

Frame

TextButton

This is the script inside the TextButton

button = script.Parent
player = script.Parent.Parent.Parent.Parent
button.MouseButton1Click:connect(function()
    wait(1)
    script.Parent.Parent.Visible = false  -- this is the part works fine
    wait()
    gun = game.Lighting.LinkedPaintballGun:Clone().Parent = player:WaitForDataReady("Backpack")

    end)

This will only work if you follow the order, just in-case it fails.

If this helped +1, if this answered your question check-mark :)

0
i figured it out myself and did it differently but it still worked, thank you though... also can i use the same idea of puting a whole map in lighting so that when i call on it it will teleport to a certain location? namelessassasin 30 — 10y
Ad

Answer this question