i have a module script which changes the value, and a server script which calls the function that changes the value, then the changed event is used however it doesnt fire
yeah, the changed events are yielding the script or anything, just isnt being fired
doesnt really make sense why it wouldnt be fired though, also in the module i added a changed event after i actually change the value just to see if that would work too but it doesnt
well possibly but the module has some functions; StartIntermission, StartGame and how the server script should work is intermission is called, then once the intermission is over in the module it changes a value, serverscript sees changed value then calls StartGame, then once the game is over it calls StartIntermission and keeps looping like that
Can you please try it? (Just the .Changed events + the print statements). This will ensure that the actual issue is caused from the code you provided initially
heres what i found out so far (i still havent tried your method yet)
the changed events wont run at all if the module.Intermission() function is called before the changed events:
this wont work:
GameFunctions.Intermission()
IntermissionEnded.Changed:Connect(function()
--print('Game Started')
GameFunctions.StartGame()
end)
GameEnded.Changed:Connect(function()
--print("Game Ended, Intermission Started")
GameFunctions.Intermission()
end
end)
--if GameFunctions.Intermission() was here, the Changed Events do work
however the problem with putting GameFunctions.Intermission()after the changed events is that for some reason that gets called when the game ends (the one in the IntermissionEnded event runs, and the one outside of it runs
this is what that looks like
IntermissionEnded.Changed:Connect(function()
GameFunctions.StartGame() --these both run at the same time, this is the problem
end)
GameEnded.Changed:Connect(function()
GameFunctions.Intermission()
end
end)
GameFunctions.Intermission() --these both run at the same time, this is the problem