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

My teleporting script dosen't work. its supposed to teleport to the brick?

-- MADE BY ROBLOX111666
Player = game.Player.LocalPlayer
Spawn = game.Workspace.SpawnLocation
BlackScreen = script.Parent.BlackScreen
TeleportButton = script.Parent.TeleportButton
HasPressedTeleport = false

function MouseEnterTeleportButton()
TeleportButton.	FontSize = "Size36"
TeleportButtton.BackgroundColor3 = Coulor3.new(255, 1, 4)

end

function MouseLeftTeleportButton()
TeleportButton.FontSize = "Size24"
TeleportButton.BackgroundColor3 = Color3.new(1,1,1)
	
end
function TeleportButton()
	if HasPressedTeleport --false then
		BlackScreen.Transparency = 1
		wait (0.1)
		BlackScreen.Transparency = 0.9
		wait (0.1) 
		BlackScreen.Transparency = 0.8
		wait (0.1)
		BlackScreen.Transparency = 0.7
		wait (0.1)
	    BlackScreen.Transparency = 0.6
		wait (0.1)
		BlackScreen.Transparency = 0.5
		wait (0.1) 
		BlackScreen.Transparency = 0.4
		wait (0.1)
		BlackScreen.Transparency = 0.3
		wait (0.1)
		BlackScreen.Transparency = 0.2
		wait (0.1) 
		BlackScreen.Transparency = 0.1
		wait (0.1)
		BlackScreen.Transparency = 0
		wait (0.1)
		Player.Character:MoveTo(Spawn.Position)
		wait(0.1)
		
		BlackScreen.Transparency = 0
		wait (0.1)
		BlackScreen.Transparency = 0.1
		wait (0.1) 
		BlackScreen.Transparency = 0.2
		wait (0.1)
		BlackScreen.Transparency = 0.3
		wait (0.1)
	    BlackScreen.Transparency = 0.4
		wait (0.1)
		BlackScreen.Transparency = 0.5
		wait (0.1) 
		BlackScreen.Transparency = 0.6
		wait (0.1)
		BlackScreen.Transparency = 0.7
		wait (0.1)
		BlackScreen.Transparency = 0.8
		wait (0.1) 
		BlackScreen.Transparency = 0.9
		wait (0.1)
		BlackScreen.Transparency = 1
		wait (0.1
	end
end
TeleportButton.MouseEnter:connect(MouseEnterTeleportButton)
TeleportButton.MouseLeave:connect (MouseLeftTeleportButton)
TeleportButton.MouseButton1Down:conect(TeleportPlayer)

2 comments

0

You should use a loop for that large function. It'll make it several lines shorter.

0

Plzs Edit it.

3 answers

You have a typo on line 72

And not sure if this is necessary, but on line 9, you put 2 spaces instead of one.

And you have to put another parenthesis on line 67

If I'm understanding this correctly, you shouldn't use:

player.Character:MoveTo()

but rather:

player.Character.Torso.CFrame = Spawn.Position

I'm not sure, though. I used it a looooong time ago.

You Made A Typo On Line 10

TeleportButtton.BackgroundColor3 = Coulor3.new(255, 1, 4)

Spelt Color Wrong

TeleportButtton.BackgroundColor3 = Color3.new(255, 1, 4)

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