I’m making a game with a rpg system. Int value can only go up to a certain max so I need an IntvalueB
here’s the script
I’m making a game with a rpg system. Int value can only go up to a certain max so I need an IntvalueB
here’s the script
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild(“creator”)
if tag ~= nil then
if tag.Value ~= nil then
local Data = tag.Value:findFirstChild(“Data”)
if Data ~= nil then
Data.Gold.Value = Data.Gold.Value + 50
Data.Exp.Value = Data.Exp.Value + 100
IntValueB.Value = math.floor(IntValueA/100)
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
Please format your code using three back ticks (`) at the beginning and end of your code
Here is your current code formatted:
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild(“creator”)
if tag == nil then return end
if tag.Value == nil then return end
local Data = tag.Value:findFirstChild(“Data”)
if Data == nil then return end
Data.Gold.Value = Data.Gold.Value + 50
Data.Exp.Value = Data.Exp.Value + 100
IntValueB.Value = math.floor(IntValueA/100)
wait(0.1)
script:remove()
end
Humanoid.Died:connect(PwntX_X)
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Data = tag.Value:FindFirstChild("Data")
if Data ~= nil then
Data.Gold.Value = Data.Gold.Value + 50
Data.Exp.Value = Data.Exp.Value + 100
IntValueB.Value = math.floor(IntValueA/100)
wait(0.1)
script:destroy()
end
end
end
end
Humanoid.Died:connect(PwntX_X)