✓ Accepted answer
I'm no advanced scripter or whatnot, so this may not be the best way... But, it works, so I'm going to post it. What you do is
insert a remote event into ReplicatedStorage called "Teleport".
In StarterGui, insert a ScreenGui, a frame into the ScreenGui, and 2 buttons in the frame.
Insert the script below into the button that teleports you (It's a local script).
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Teleport:FireServer()
script.Parent.Parent.Visible = false
end)
Insert the script below into the button that declines the TP offer (It's a local script).
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
end)
Insert a server script into StarterCharacterScripts (in StarterPlayer).
while true do
wait(.1)
if game.Lighting.TimeOfDay == "14:00:00" then
print("did it")
local player = game.Players:GetPlayerFromCharacter(script.Parent)
player.PlayerGui.ScreenGui.Frame.Visible = true
end
end
Last and certainly least, insert a server script into ServerScriptService.
game.ReplicatedStorage.Teleport.OnServerEvent:Connect(function(player)
local char = player.Character
local position = Vector3.new(0,0,0)
if char ~= nil then
char:MoveTo(Vector3.new(position))
end
end)
Hope this helped!! :D
1 comment
I really do appreciate your help NiroTurtle, you explained everything thouroughly and clearly! This setup works wonders for what I was trying to achieve, I do appreciate you taking time out of your day to help me out.