Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to fix problem regarding remove events?

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

5 comments

0

is the printing nil the problem that you're having?

0

I don't know, I just can't fire the local script.

0

It's working perfectly fine for me

0

your post said that the event was called "remote". Is it called "remote" or "Remote"?

0

Sorry, case sensitivity

1 answer

✓ Accepted answer

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

1 comment

0

lmao

This discussion is preserved as it was. New answers, comments, and votes are closed.