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

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

Asked by
nanaluk01 247 Moderation Voter
10 years ago
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

Closed as Not Constructive by User#2

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
X888X 15
10 years ago

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)
Ad