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

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

Asked by 9 years ago
-- 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)
0
You should use a loop for that large function. It'll make it several lines shorter. aquathorn321 858 — 9y
0
Plzs Edit it. roblox111666 0 — 9y

3 answers

Log in to vote
0
Answered by 9 years 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)

Ad
Log in to vote
0
Answered by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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.

Answer this question