The teleport works perfectly and I was able to enable the UI when I put the single line of code responsible for it (game.StarterGui.Level2.Enabled = true) in a script by itself. I’m not getting any errors when I do this either, yet the UI still isn’t appearing. Any help would be greatly appreciated!
local Teleport = "Endpoint" -- Destination
local TweenService = game:GetService("TweenService")
local UI = game.StarterGui.Level2.TextLabel
local info = TweenInfo.new(
5, --Time animating
Enum.EasingStyle.Sine, --Easing style
Enum.EasingDirection.Out, --Easing direction in/out/inout
0, --Repetitions
false, --Reverse post tween?
0 --Delay time
)
local goal = {
TextTransparency = 1;
TextStrokeTransparency = 1;
}
local fadingtext = TweenService:Create(UI, info, goal)
function Touch(hit)
if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true --Checks Debounce
local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to
hit.Parent:moveTo(Pos.Position)
game.StarterGui.Level2.Enabled = true
wait(3.5)
fadingtext:play()
script.Parent.Locked = false
script.Parent.Parent:findFirstChild(Teleport).Locked = false
end
end
script.Parent.Touched:connect(Touch)
StarterGui is what the player is given when they join. When you change it, it doesn’t change what the player sees because it was already given to the player.
PlayerGui is what the player currently sees. That is why when you change the PlayerGui, it changes what the player sees.
Here is a script:
(also you shouldn’t mark a post as a solution if you didn’t fix it yet, I also organized your code better)
--//Services
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
--//Variables
local Part = script.Parent
local Info = TweenInfo.new(
5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local Goal = {
TextTransparency = 1;
TextStrokeTransparency = 1;
}
--//Functions
Part.Touched:Connect(function(Hit)
local Player = Players:GetPlayerFromCharacter(Hit.Parent)
if Player and Part.Parent.Locked == false and Part.Parent:FindFirstChild("Waypoint").Locked == false then
Part.Locked = true
Part.Parent.Waypoint.Locked = true
local Position = Part.Parent.Waypoint.Position
Hit.Parent:MoveTo(Position)
Player.PlayerGui.Level2.Enabled = true
task.wait(3.5)
local fadingtext = TweenService:Create(Player.PlayerGui.Level2.TextLabel, Info, Goal)
fadingtext:Play()
Part.Locked = false
Part.Parent.Waypoint.Locked = false
end
end)
That’s a problem on your end because I’m assuming that these paths actually lead somewhere. The error is saying that you didn’t add a Locked value to your teleporter so you should go add one.