hello, i’m making a horror game and i’ve created a part with a serverscript inside of it, basically making it so that if the player steps on the part, objects in replicatedstorage move to workspace. i disabled that script.
the problem is that theres a localscript in startergui thats supposed to ENABLE that serverscript, and when i test, the serverscript is enabled, but none of it is functioning/running like i want it to.
i’ve been facing this problem for a while now, so any help would be GREATLY appreciated!
As @kexy123 said, You can’t enable a serverScript in a LocalScript.
use RemoteEvents.
Code example :
-- local script
local event = game.ReplicatedStorage.RemoteEvent -- insert your remoteEvent here
wait(5) -- the time you want to enable the serverscript
event:FireServer()
-- server script
local event = game.ReplicatedStorage.RemoteEvent -- insert your remoteEvent here
local function somethingtoDo()
-- something you want to do when event is fired
end
event.OnServerEvent:Connect(somethingtoDo)