So I have a script in StarterPack, that checks when a stun value is true, and then when the value is true, it uses a remote event to do my stun function, however, when the stun value is true, the script never activates and i'm not sure why.
Local Script:
local Player = game.Players.LocalPlayer
local Character = Player.CharacterAdded:Wait()
local root = Character:WaitForChild("HumanoidRootPart")
local stunned = Character:WaitForChild("Stunned")
local stuntime = 1
repeat wait() until stunned
if stunned.Value == true then
script.RemoteEvent:FireServer(Player, stunned, root)
end
Remote event:
local Cooldown = false
local stuntime = 1
script.Parent.OnServerEvent:Connect(function(Player, stunned, root)
root.Anchored = true
wait(stuntime)
root.Anchored = false
stunned.Value = false
end)

6 comments
let me know if you still have problems after trying the new code / following the advice in troubleshoot list. it's ok if u do. I just want to make sure you get your code working.
Thanks a lot for the help. I was able to get the scripts working up until the last line of the server script, the "stunned.Value = false", the character gets rooted, but the stun value never turns off.
Ah, that's because we never defined stunned. My bad. I will do that right now.
see my edit please
Thank you so much, the script works.
Cheers