Since only local scripts can be put on server scripts?
Server script(Stamina Regen):
local plr = script.Parent.Parent
plr.MaxStamina.Value = (plr.Stats.Vitality.Value*4)+100
local MaxStam = plr.MaxStamina.Value
db = false
function regenStamina()
if not db then
db = true
while plr.Stamina.Value<MaxStam do
plr.Stamina.Value = plr.Stamina.Value + (MaxStam/10)
if plr.Stamina.Value>MaxStam then
plr.Stamina.Value = MaxStam
end
wait(1)
end
if plr.Stamina.Value < 0 then
plr.Stamina.Value = 0
end
db = false
end
end
function addStamina ()
MaxStam = (plr.Stats.Vitality.Value*4)+100
plr.MaxStamina.Value = MaxStam
regenStamina()
end
function giveStamina()
addStamina()
plr.Stamina.Value = MaxStam
end
plr.CharacterAdded:Connect(giveStamina)
plr.Stats.Vitality.Changed:Connect(addStamina)
plr.Stamina.Changed:Connect(regenStamina)

2 comments
It was my original script, however the stamina doesnt regen on real game so I had to put it in server script.
well then in that case you have to use eigher a single script which handles stamina regen for everyone, or use remote events to communicate to the server. i recomend doing something like herrtt mentioned above