so if I teleport to "Island1" first, I can teleport to "Island1" again, but I can't teleport to "Island2" after I teleport to "Island1", same goes for the other way around...
local island1 = script.Parent:FindFirstChild("1") local island2 = script.Parent:FindFirstChild("2") local player = script.Parent.Parent.Parent.Parent local teleport = player:FindFirstChild("SS").Teleport local d = false local c = false island1.MouseButton1Down:Connect(function() if d == false then d = true if teleport.Value >= 0 then player.Character:FindFirstChild("Torso").CFrame = game.Workspace.Island1.CFrame for i = 30,0,-1 do island1.Text = i wait(1) if i <= 0 then d = false end end end end end) island2.MouseButton1Down:Connect(function() if c == false then c = true if teleport.Value >= 1 then player.Character:FindFirstChild("Torso").CFrame = game.Workspace.Island2.CFrame for i = 30,0,-1 do island2.Text = i wait(1) if i <= 0 then c = false end end end end end)
I think you're overcomplicating this, you just want to teleport between two islands when they are clicked on? I don't know exactly what you want but you could take mouse input from a local script and use a server script to execute the teleport
Example:
Server Script:
game.ReplicatedStorage.RemoteEvents.Teleport.OnServerEvent:connect(function(plr,hit) plr.Character:SetPrimaryPartCFrame(hit.CFrame+Vector3.new(0,4,0)) end)
Local Script:
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:connect(function() if mouse.Target.Name == "P1" or mouse.Target.Name == "P2" then game.ReplicatedStorage.RemoteEvents.Teleport:FireServer(mouse.Target) end end)
Again, I don't really know exactly what you're trying to do but there ya go