Still have questions? Join our Discord server and get real time help.
0

# how can i use powerlevels to define a value in this algorithm????

Edited by M39a9am3R 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

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.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")
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)
local newscreen = screen:Clone()
newscreen.Parent = game.StarterGui
end
end)

function Start(Player)
on.Changed:connect(function() if on.Value == true then On(Player) end end)
end

function On(Player)
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)
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

0
Code block please. The little Lua button when editing. GoldenPhysics 471 — 3y
0
*identation please* RubenKan 3590 — 3y
0
what do u mean? i cant understand what ur trying to say sir. Kingaskhan -5 — 3y