I get an error while testing my portal.
Error:
Attempt to index nil with "Fade"
Local Script:
local Player = game.Players.LocalPlayer
local TeleportService = game:GetService("TeleportService")
local TeleportEvent1 = game.ReplicatedStorage:FindFirstChild("TeleportEvent1")
local TeleportEvent2 = game.ReplicatedStorage:FindFirstChild("TeleportEvent2")
local TeleportGui = Player.PlayerGui:FindFirstChild("TeleportGui")
local TweenService = game:GetService("TweenService")
TeleportEvent1.OnClientEvent:Connect(function()
TweenService:Create(TeleportGui.Fade, TweenInfo.new(1), {BackgroundTransparency = 0}):Play()
task.wait(1.5)
TeleportService:Teleport(6667412878)
end)
TeleportEvent2.OnClientEvent:Connect(function()
TweenService:Create(TeleportGui.Fade, TweenInfo.new(1), {BackgroundTransparency = 0}):Play()
task.wait(1.5)
TeleportService:Teleport(2572204670)
end)
Script:
local Players = game:GetService("Players")
local teleport = script.Parent
local TeleportEvent = game.ReplicatedStorage:FindFirstChild("TeleportEvent1")
local sound = teleport.TeleportSound
local debounce = false
teleport.Touched:Connect(function(touch)
local Player = Players:GetPlayerFromCharacter(touch.Parent)
if not debounce and Player then
debounce = true
TeleportEvent:FireClient(Player)
sound:Play()
task.wait(3)
debounce = false
end
end)
Any help is appreciated, thanks.