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

What code and where can I put it to make the button give me tools aswell?

Places = {Vector3.new(383.4, 254, -630.8), Vector3.new(384.4, 254, -675.6), Vector3.new(328.6, 254, -813.4), Vector3.new(248.4, 254, -788), Vector3.new(257, 254, -655), Vector3.new(380.2, 254, -791.8)} ---Change the figures inside the "("'s to where you want a player to randomly teleport. You can more, too.
local Player = script.Parent.Parent.Parent.Parent
--------------------------------------Please don't Touch anything under this line unless you know what you are doing.-----
function Click()
Player.Character:MoveTo(Places[math.random(1,#Places)])
wait()
script.Parent.Parent = game.StarterGui
script:remove()
wait()
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
end

script.Parent.MouseButton1Down:connect(Click)

What code and where can I put it to make it give items when the button is clicked? Please help me! Thx ~Nanaluk01

1 answer

✓ Accepted answer

Try this, tell me if it works!

Places = {Vector3.new(383.4, 254, -630.8), Vector3.new(384.4, 254, -675.6), Vector3.new(328.6, 254, -813.4), Vector3.new(248.4, 254, -788), Vector3.new(257, 254, -655), Vector3.new(380.2, 254, -791.8)} ---Change the figures inside the "("'s to where you want a player to randomly teleport. You can more, too.
local Player = script.Parent.Parent.Parent.Parent
--------------------------------------Please don't Touch anything under this line unless you know what you are doing.-----
function Click()
Player.Character:MoveTo(Places[math.random(1,#Places)])
wait()
script.Parent.Parent = game.StarterGui
script:remove()
wait()
--I added this code to add a tool to the players backpack, enjoy!
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.Lighting.ENTER_TOOL_NAME_HERE:Clone().Parent = game.Players.LocalPlayer.Backpack
end
 
script.Parent.MouseButton1Down:connect(Click)

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