Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Filtering enabled round script wont work?

Asked by 6 years ago

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)
0
line one in the server script mattchew1010 396 — 6y
0
Does not work poopstermaniac 1 — 6y

3 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

0
Server script = normal script fighter169mobile 123 — 6y
0
Then do i use :fireclient? poopstermaniac 1 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try this with teleporting Characters.

player.Character.Humanoid:MoveTo(Vector3.new(workspace.tele.Position))
Log in to vote
0
Answered by
Troxure 87
6 years ago

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

Answer this question