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

Help to make a script that spawns a teleport brick?

Asked by 5 years ago

I need to make a script that spawns the teleport brick I have infront of the player at a time. Like from the car speed. I think it is possible because ik that u can have click teleport and other stuff too.

0
Like teleport a plyer when touched? 0_Halloween 166 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
local part = Instance.new("Part", workspace) --this will make a part in the workspace
part.CFrame = CFrame.new(10,0,0) --the part will spawn at the location 10,0,0
part.BrickColor = BrickColor.new("Deep orange") -- the part will be orange

part.Touched:connect(function(hit)
    if hit.Parent.Name == "Humanoid" then --checks if a player touches the brick
        hit.Parent.Torso.CFrame = CFrame.new(10, 50, 0) -- teleports the player at 10,50,0
    end
end)
Ad
Log in to vote
0
Answered by
OBenjOne 190
5 years ago

Remember that this is not a request site. I will not give you a script but only an idea you must make into a script yourself. I don't know if there is a command like instance.new spawn point, but cloning is bound to work. Here is an idea: make a spawn point and put it in server storage. Then, create a script, put it in Starter character scripts and put some code like this in it:

--clone the SpawnPoint SpawnPoint = game.ServerStorage.SpawnPoint:Clone() --SpawnPoint is the name of the SpawnPoint SpawnPoint.Parent = workspace

After these lines you can change the SpawnPoint's position:

SpawnPoint.Position = --script.Parent.Head.Position???

I probably gave you too much of the script but use this to create your own. Once you have tried, you may post your script here so we can help with problems you have.

Ps. The script I gave you does not move the SpawnPoint or delete it when the player dies. Do that yourself.

0
Oops!!! Thought that you wanted a SpawnPoint not a Teleporting part!!! Will work if you replace SpawnPoint with teleport OBenjOne 190 — 5y

Answer this question