I have been trying for 3 hours now, the "Spread" function in the "ServerSide" script isnt running when invoking "InvokeServer()", out of all the prints in here the only thing printed to chat is this: "Temp debug: Invoking server"
No errors happen.
"Main" local script, trying to invoke the function that isnt working
local SpreadEvent = script:WaitForChild("Spread") function Spread() print("Temp debug: Invoking server") local Target = SpreadEvent:InvokeServer() --made a oversight, now it does alot of stuff in a normal script so other clients receive it print("Temp debug: Server Responded") ****Removed rest of code since its not related**** end
"ServerSide" Script, This function is the one i want to run
local SpreadEvent = script.Parent:WaitForChild("Spread") function Spread() print("Temp debug: Spread Assister Called (Server-side)") local PossibleAreas = FindFreeLocations() local Target = PossibleAreas[math.random(1,#PossibleAreas)] --Chooses random bodypart if #PossibleAreas == 0 then return end local NewResources = Resources:Clone() local Infector = Resources.Scripts.Infect:Clone() NewResources.Parent = Infector Infector.Parent = Target Infector.Disabled = false print("New bodypart (".. Target.Name.. ") Infected.") coroutine.wrap(HpChangeSymptom)() return Target end SpreadEvent.OnServerInvoke = Spread
These are only snippets of the scripts related to the issue
Explorer view of the scope the scripts use (Image, couldn't attach files): https://ibb.co/qBZhvHK
After 2 days of debugging, the issue was caused by the scripts parent being the local script, i spent a day and reworked all the code so now its reversed