#It wont spawn the xp part

24 messages · Page 1 of 1 (latest)

hollow gale
#
local char = script.Parent
local human = char:WaitForChild("Humanoid")
local humanRoot = char:WaitForChild("HumanoidRootPart")

local cash = game.ReplicatedStorage:WaitForChild("Cash")
local xpPart = game.ReplicatedStorage:WaitForChild("xpPart")
human.Died:Connect(function()
    local moneyDropped = math.random(10,25)
    local cashClone = cash:Clone()
    cashClone.BillboardGui.amountOfCash.Value = moneyDropped
    cashClone.BillboardGui.amount.Text = "$" .. tostring(moneyDropped)
    
    cashClone.Parent = game.Workspace
    
    cashClone.CFrame = humanRoot.CFrame == (humanRoot.CFrame.LookVector + Vector3.new(2,2,2))
    

    local xpClone = xpPart:Clone()

    xpClone.Parent = game.Workspace

    xpClone.CFrame = humanRoot.CFrame == (humanRoot.CFrame.LookVector + Vector3.new(2,2,2))
end)
```this is the eror
```Unable to assign property CFrame. CoordinateFrame expected, got boolean ```
jovial crest
#

now try again```lua
local char = script.Parent
local human = char:WaitForChild("Humanoid")
local humanRoot = char:WaitForChild("HumanoidRootPart")

local cash = game.ReplicatedStorage:WaitForChild("Cash")
local xpPart = game.ReplicatedStorage:WaitForChild("xpPart")
human.Died:Connect(function()
local moneyDropped = math.random(10,25)
local cashClone = cash:Clone()
cashClone.BillboardGui.amountOfCash.Value = moneyDropped
cashClone.BillboardGui.amount.Text = "$" .. tostring(moneyDropped)

cashClone.Parent = game.Workspace

cashClone.CFrame = humanRoot.CFrame + (humanRoot.CFrame.LookVector + Vector3.new(2,2,2))


local xpClone = xpPart:Clone()

xpClone.Parent = game.Workspace

xpClone.CFrame = humanRoot.CFrame + (humanRoot.CFrame.LookVector + Vector3.new(2,2,2))

end)```

hollow gale
#

k gime a few mins afk

#

o it worked

#

what do those two = equal signs change tho

jovial crest
#

where im confused

foggy moss
#

== is used for checking if a value is something or not

#

You use one = only for setting things

#

Like a value or variable

hollow gale
#

o

foggy moss
#

So you can’t do variable == true

#

Or if this = that

hollow gale
#

but == still spawned the cash but not the xp

foggy moss
#

No you only used 1 = for the cash look again

hollow gale
#

im lost bro

foggy moss
#

This was written wrong

#

Remove the humroot.cframe ==

#

Keep the one enclosed in paranthesis

hollow gale
#

o

#

i think i get it

#

== didnt work cause im like checking if smth is true but i cant because its not a boolean

#

soo i could just plus or delete the humroot == part

#

thx u two 🙂