What's wrong with this 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

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)

I have it formatted but it doesn’t show it formatted

Its formatted in my game but it doesnt show its formatted here.

Also, you need to change findFirstChild to FindFirstChild

Why are you deleting the script? Also use script:Destroy() since script:Remove() is depecrated

oh. The only script that doesnt work is the one with math.floor

You need to put your code between three ` at the beginning and end of your code

How do u show the script like u did

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) 

Where did you get that information?

I made some changes to your script in my first response, nothing changed functionality wise however it’s just cleaner now

oh the only thing that doesn’t work now is IntValueB.Value = math.floor(IntValueA/100)

I don’t see any definition of an IntValueA or IntValueB in the script you provided.

Also you might need to use IntValueA.Value

Try

IntValueB.Value = math.floor(tonumber(IntValueA)/100)

alright ill try it just a second

Both solutions didn’t work :confused: How do you define the line with xp as "IntvalueA

Where are you referencing/defining IntValue A and B in your script

A guy helped me and said to do the script with int value a
His username is @TortenSkjold

Can I see output?
(char limit)