Im making a round script with FE and i'm fairly new to scripting. I thought I did everything right as it worked when I played solo but when I started a server it wouldn't work.
My remote event is located in Replicated Storage and so is my int val
Script this is located in ServerScriptService
local play = game.Players.LocalPlayer local Int = game:GetService("ReplicatedStorage"):WaitForChild("Int") game.ReplicatedStorage.Intermis.OnServerEvent:Connect(function(player, text, tim) while true do text.Text = "Intermission = "..Int.Value Int.Value = Int.Value - 10 wait(1) if Int.Value == 0 then for _,player in pairs (game.Players:GetPlayers()) do if player.Character then player.Character:MoveTo(Vector3.new(game.Workspace.tele.Position)) text.Visible = false if text.Visible == false then for i = 6, 1, -1 do tim.Visible = true tim.Text = "Time Left = "..i wait(1) if i == 1 then play.Character:MoveTo(Vector3.new(197.927, -48.632, -116.923)) Int.Value = 30 text.Visible = true tim.Visible = false end end end end end end end end)
Local Script It is located in a ScreenGui which is located in StarterGui and so is both TextLabels (the time is also a TextLabel)
local inter = game:GetService("ReplicatedStorage") inter:WaitForChild("Intermis"):FireServer(script.Parent.TextLabel, script.Parent.time)
Local scripts don't work on the server, sending the local script to the (server) script will appear nil to the server. Good to test local and server script interaction online to avoid having these issues in the future.
GUIs only work inside a PlayerGui in a ScreenGui. It won't work on the script in ServerslScriptStorage, don't send GUIs to the server.
Try this with teleporting Characters.
player.Character.Humanoid:MoveTo(Vector3.new(workspace.tele.Position))
Your first line you're trying to access LocalPlayer through a script, which the LocalPlayer can only be accessed through a client sided method, in other words a LocalScript