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

how to fix problem regarding remove events?

Asked by 4 years ago
Edited 4 years ago

I have a problem with a script regarding remote events (events are actually just slamming me at this point lol)

Here is the script I'm using to fire the local script (bc this is a server script)

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")

-- Variables
local playercount = #game.Players:GetPlayers()
print("This is the player Count")
print(playercount)

local req_num_players = 0  



--while true do
    wait()


    -- repeat until used to make sure there are two people in the server before the games starts
    repeat
        print("Waiting for more players")
        wait()
    until playercount >= req_num_players
        print("enough players detected")
        print("Server Script passed the repeat until loop")
        wait()
        remote:FireAllClients(true)
        --print("FireAllClients just sent true to all clients")



--end

Here is the local script

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")
print("local script is running")
remote.OnClientEvent:connect(function(decider)
    if decider then
        print("Server passed decider as true")
        loop_starter = decider
        return loop_starter
    else 
        print("Server did not pass decider as true ")    
    end        

end)

print("Checking for loop_starter value")
print(loop_starter)

The local script is in the starterplayerscripts and I called the remove event "remote" in replicated storage

thx

0
is the printing nil the problem that you're having? ThisIsAnAccount255 143 — 4y
0
I don't know, I just can't fire the local script. JackTheGamer44666 18 — 4y
0
It's working perfectly fine for me ThisIsAnAccount255 143 — 4y
0
your post said that the event was called "remote". Is it called "remote" or "Remote"? ThisIsAnAccount255 143 — 4y
0
Sorry, case sensitivity JackTheGamer44666 18 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Your mistake is that your scripts are trying to find ReplicatedStorage.Remote. While your remote is at ReplicatedStorage.remote.

0
lmao TheluaBanana 946 — 4y
Ad

Answer this question