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

Gui Teleporter Is Not Working And I Need Help?

Asked by 4 years ago
Edited 4 years ago

I am trying to make a gui teleporter for my game and it just won't work The System I Have Uses Blocks Called Teleport1.

Player = game.Players.LocalPlayer
BlackScreen = script.Parent.Parent.BlackScreen
TeleportButton1 = script.Parent.TeleportButton1
Spawn3 = game.Workspace.Teleport3
Spawn1 = game.Workspace.Teleport1
HasPressedTeleport = false

function TeleportPlayer()
    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(Spawn1.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
    end
end


TeleportButton1.MouseButton1Down:connect(TeleportPlayer)

Not Trying To Be Greedy But I Would Appreciate It If Someone Could Help Me In The Next Month Or So,

0
Kind of unrelated but you can use TweenService for your transparency animation compUcomp 417 — 4y

1 answer

Log in to vote
1
Answered by
harstud 218 Moderation Voter
4 years ago

Seen someone use MoveTo on a player before, I seriously don't recommend it.

Player = game.Players.LocalPlayer
BlackScreen = script.Parent.Parent.BlackScreen
TeleportButton1 = script.Parent.TeleportButton1
Spawn3 = game.Workspace.Teleport3
Spawn1 = game.Workspace.Teleport1
HasPressedTeleport = false

local function TeleportPlayer()
    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:WaitForChild("HumanoidRootPart").CFrame = Spawn1.CFrame
        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
    end
end


TeleportButton1.MouseButton1Down:connect(TeleportPlayer)
Ad

Answer this question