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

script to teleport players touching a brick to a random map??

I have been trying this out for a hour, I'm quite new to scripting and I have been using this site for a while, looking at posts for reference, tho I never made a account till now. I don't have anything of use of a script I was using but I would really appreciate it if one you could help me out with this!

Thanks!

KitAffects.

value = math.random(1,3) if number(1)then function onTouched(m) p = m.Parent:findFirstChild("Humanoid") if p ~= nil then p.Torso.CFrame = CFrame.new(insert map location here) end end script.Parent.Touched:connect(onTouched) end

if number(2)then function onTouched(m) p = m.Parent:findFirstChild("Humanoid") if p ~= nil then p.Torso.CFrame = CFrame.new(insert map location here) end end script.Parent.Touched:connect(onTouched) end if number(2)then function onTouched(m) p = m.Parent:findFirstChild("Humanoid") if p ~= nil then p.Torso.CFrame = CFrame.new(insert map location here) end end script.Parent.Touched:connect(onTouched) end

4 comments

0

Give us some of the attempts. This isnt a request site. Oh well its not like I care about it anyways. Ill try to make the script. Also what do you mean about a random map

0

kk

0

thanks a lot. I edited the question to include something i pieced together.

0

by random map I mean the location of the map the players will be fighting in,

1 answer

✓ Accepted answer

Heres a basic version. It will teleport you very fast but does the job,

local map = {}--insert map location like game.workspace.map.MAP_NAME
-- Example: local map = {game.Workspace.Map,game.Workspace.Map2,game.Workspace.Part}
script.Parent.Touched:Connect(function(hit)
   for i,v in pairs(game.Players:GetChildren())do
	if hit.Parent ~= nil then
		if hit.Parent.Name == v.Name then
			local HumanoidRootPart = hit.Parent:FindFirstChild("HumanoidRootPart")
			if HumanoidRootPart ~= nil then
				HumanoidRootPart.CFrame = map[math.random(1,#map)].CFrame
			end
			end
		end
	end
end)

2 comments

0

If this helps please accept the answer

0

Also comment here if you have any problems

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