I pretty much think that the script used for the lighting interfere with the teleport script somehow. Try replacing the lighting Script by a Local Script and use a script to detect the player touching the part:
local Event = game:GetService("ReplicatedStorage").RemoveEvent
local Part = script.Parent
game.Players.PlayerAdded:Connect(function(Player)
Part.Touched:Connect(function(touched)
if Player.Character == touched.Parent then
Event:FireClient(Player)
end
end)
end)
(Put the script in the part)
Add a RemoteEvent in ReplicatedStorage (name it whatever you want)
Next take the lighting local script and place it in StarterPlayerScripts and add this piece of code:
local Event = game:GetService("ReplicatedStorage").RemoteEvent
Event.OnClientEvent:Connect(function()
local Lighting = game:GetService("Lighting")
Lighting.Ambient = Color3.new(0.517647, 0.466667, 0.631373)
Lighting.Brightness = 9.58
Lighting.ColorShift_Bottom = Color3.new(0.666667, 0, 0.498039)
Lighting.ColorShift_Top = Color3.new(0.411765, 0.368627, 1)
Lighting.EnvironmentDiffuseScale = 0.186
Lighting.EnvironmentSpecularScale = 1
Lighting.OutdoorAmbient = Color3.new(0.211765, 0.152941, 0.262745)
Lighting.ShadowSoftness = .32
Lighting.TimeOfDay = 0
Lighting.GeographicLatitude = 0
local bloom = Lighting:FindFirstChildOfClass("BloomEffect")
if bloom then
bloom.Intensity = .2
bloom.Threshold = 0.5
bloom.Size = 2
end
local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere")
if atmosphere then
atmosphere.Density = 0.304
atmosphere.Offset = 0.712
atmosphere.Color = Color3.new(0.737255, 0.505882, 1)
atmosphere.Decay = Color3.new(0.666667, 0, 0.498039)
atmosphere.Glare = 0.64
atmosphere.Haze = 0.76
end
local depthOfField = Lighting:FindFirstChildOfClass("DepthOfFieldEffect")
if depthOfField then
depthOfField.FarIntensity = 1
depthOfField.FocusDistance = 11.2
depthOfField.InFocusRadius = 23.2
depthOfField.NearIntensity = 1
end
end)
What I did is that I replaced the lighting script by a Local Script to make the lighting change only of the specific client and detected if this client was touching the part via the script. If so the script would trigger the RemoteEvent, giving to the LocalScript the fact that the player touched the part.
I don’t know why I didn’t think of local scripts! I guess I forgot, thank you for the suggestion! However, I followed word for word and ended up with no results.
I saved my original code of course, and disabled the script. This might just be something extremely simple and I’m just not able to get it, but thank you so very much for helping nonetheless ^^