i want to make a dbz server, where power lvl means hp, atk def, i made this script but i need help, i cant present the stuff i want
game.Players.ChildAdded:connect(function(Player) wait(.1) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Value = 0 stats.Parent = Player local newstat = Instance.new("IntValue") newstat.Name = "PowerLevel" newstat.Value = 200 newstat.Parent = stats local newstat = Instance.new("BoolValue") newstat.Name = "game" newstat.Value = false newstat.Parent = Player local screen = Instance.new("ScreenGui") local gui = Instance.new("TextLabel") local on = Instance.new("BoolValue") screen.Name = "Alert" gui.Name = "Notice" on.Name = "On" gui.BackgroundTransparency = 1 gui.Size = UDim2.new(1, 0, 0, 35) gui.Position = UDim2.new(0, 0, 0.1, 0) gui.BackgroundColor = BrickColor.new("Navy blue") gui.BorderColor = BrickColor.new("White") gui.TextColor = BrickColor.new("White") screen.Parent = Player.PlayerGui gui.Parent = screen on.Parent = gui Start(Player) if game.StarterGui:findFirstChild("Alert") == nil then local newscreen = screen:Clone() newscreen.Parent = game.StarterGui end end) function Start(Player) local on = Player.PlayerGui.Alert.Notice.On on.Changed:connect(function() if on.Value == true then On(Player) end end) end function On(Player) local gui = Player.PlayerGui.Alert.Notice while true do wait() gui.BackgroundTransparency = gui.BackgroundTransparency - 0.02 if gui.BackgroundTransparency < 0.1 then Off(Player) break end end end function Off(Player) local gui = Player.PlayerGui.Alert.Notice wait(2) while true do wait() gui.BackgroundTransparency = gui.BackgroundTransparency + 0.02 if gui.BackgroundTransparency >= 1 then gui.On.Value = false gui.Text = "" break end end end
my trouble is that it is only displaying, i cant get it work as a base mechanic of the fighting game
yep, so how do i add a algorithm in this code such that, every power level % from a unit grants basic roblox stats such as more damage, more hp, i tried adding a feature where every punch gives u power level, but it seems i dont know how i can connect punch script with this so punch gives pl and this script calculates
i tried using mob.Health = 100 Power Level, but doesnt work because i cant set a certain power = how much attack, i also tried putting upon mob kill u get 100 power level but doesnt work please help i worked hard and i just need to implement the features, the script is 80% done