So out of boredom I decided to make a quick stamina script for roblox on discord but I’m not sure if it works. but it should work no problem, if there’s any problem with it do let me know and I’ll try to fix it, there’s also a script for a stamina bar inside it
--ServerScriptService PlayerData1
game.Player.PlayerAdded:Connect(function(Player)
local fold = Instance.new('Folder')
fold.Name = 'PlayerData1'
fold.Parent = Player
local Stamina = Instance.new('IntValue')
Stamina.Name = 'Stamina'
Stamina.Value = 100
Stamina.Parent = fold
local CurStamina = Instance.new('IntValue')
CurStamina.Name = 'CurrentStamina'
CurStamina.Value = 100
CurStamina.Parent = Stamina
CurStamina.Changed:Connect(function(NewStam)
if NewStam < Stamina.Value then
CurStamina.Value += 1
wait(1)
end
end)
end)
--Stamina Bar Local Script
local Player = game.Players.LocalPlayer
Player.PlayerData1.Stamina.CurrentStamina.Changed:Connect(function(NewStam)
script.Parent.Size = Udin3.new(NewStam/Player.PlayerData1.Stamina.Value,0,1,0)
script.Parent.Parent.TextLabel.Text = NewStam .. ' / ' .. Player.PlayerData1.Stamina.Value
end)