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

Help to make a script that spawns a teleport brick?

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.

1 comment

0

Like teleport a plyer when touched?

2 answers

✓ Accepted answer
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)

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.

1 comment

0

Oops!!! Thought that you wanted a SpawnPoint not a Teleporting part!!! Will work if you replace SpawnPoint with teleport

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