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

Gui Teleporter Is Not Working And I Need Help?

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,

1 comment

0

Kind of unrelated but you can use TweenService for your transparency animation

1 answer

✓ Accepted answer

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)

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