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

How would i create a script that takes the tool out of the script?

Asked by 6 years ago

I have a gui with a button, and inside the button is a script, and inside the script is a sword.

Im trying to script it so that when you click the button, you get the sword inside the script.

i have searched the wiki and cant figure it out

function onClick(mouse)
-- now what

1 answer

Log in to vote
0
Answered by 6 years ago
script.Parent.MouseButton1Click:connect(function()
    local sword = script.Sword:Clone()
    sword.Parent = game.Players.LocalPlayer.Backpack
end)

That should work!

Ad

Answer this question