nope still does not work nothing printed
want a copy of the game? (its so basic idc about uploading it)
That would be helpful as even Iām confused now
Okay your issue was a simple one, in your event that increases the coins, you were immediately getting whatever was inside of the Value property of the coin, you have to reference the Coins IntValue and update the Value yourself, basically your scritp that handles awarding should be this
local player = game:GetService("Players")
local coin = script.Parent -- Path to coin
local Coins = game.Workspace.Coins
local used = false
function giveCoin(part)
if part.Parent:FindFirstChild("Humanoid") == nil or used == true then
return
end
used = true
local player = player:GetPlayerFromCharacter(part.Parent)
Coins.Value += 1
print(Coins)
coin.coincollect:Destroy()
coin:Destroy()
print("it should have worked")
end
coin.Touched:Connect(giveCoin)
Also you really need to fix the script around since thereās some confusing code/unneeded code
thanks it works perfectly ill mark the first message you sent as the answer for if anyone else is confused
Anytime! If you have anymore isuses donāt be afraid to make another post!
Also, I recommend you fix up the general organization of the coins since youād have 2 scripts for each coin, itās better to have it set up so a single script handles the touched events
FYI the newVal parameter is the name of the property that changed not the new value.
Doesnāt apply for BaseValues, the Changed event for Basevalues, such as IntValues, returns the new value, what you mentioned is for other instances