#ServerScript not running

1 messages · Page 1 of 1 (latest)

glad heath
#

i have a very simple server script (in ServerScriptService):


local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = replicatedStorage.LobbyItems:WaitForChild("startArenaEvent") 

local function startArena()
    print("Starting arena") 
end

remoteEvent.OnServerEvent:Connect(startArena)```
however neither "Server script started" or "Starting arena" prints, anyone know why?
#

ive confirmed its enabled as well

#

also (likely unrelated as the first print doesnt even work), the client script is working just fine

#

here is the very simple client script just in case, prints "firing server" without issue

local remoteEvent = replicatedStorage.LobbyItems:WaitForChild("startArenaEvent")

script.Parent.MouseButton1Click:Connect(function()
    print("Firing server")
    remoteEvent:FireServer()
end)```
#

explorer:

wild hedge
#

local scripts dont run in replicated storage

#

they only run in player replicated things such as playergui, playerscripts, the character

glad heath
#

the script in question is createArenaScript which is not a local script

wild hedge
glad heath
#

in the actual game it's parent is the local player

#

the serverTemplate is cloned in the player's gui

wild hedge
#

could you send a video of you attempting it with the explorer open to the playergui?

glad heath
#

i think i just got it actually

#

i was doing a team test instead of normal test and then the prints worked

#

but now i dont know why print doesnt work in team test or if any of the rest of the script will work

swift compass