Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

need help on this GUI script?

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

✓ 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 :)

1 comment

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.