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)
✓ ANSWER ACCEPTED
need help on this GUI script?
1 answer
✓ Accepted answer
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 :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
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?