So im just trying to improve my scripting by creating games and this is a simulator game im trying to make just to gain some more experience the script is working but it wont multiply by the multiplier int value that i have in the player
local parent = script.Parent
parent.Touched:Connect(function(part)
local mark = part.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if mark then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.leaderstats.Sand.Value * player.Values.Multiplier.Value
player.leaderstats.Sand.Value = player.leaderstats.Sand.Value - player.leaderstats.Sand.Value
end
end)
ik my scripts are messy its just a bad habit i have

3 comments
Line 08 sets their sand value to 0, I don't know if that's intended, but you can write it as = 0 //Additionally you should probably switch line 6 and line 5, as it won't find a player if there's no Humanoid anyway. // Are you sure there's a Values.Multiplier value in the player? Is there any output?
Yes i am sure there is a values.multiplier value in the player and no there isnt anything in the output i just figured out the problem its because it adds 0.50 to the multiplier and looks like roblox doesnt support frictional values im searching for an answer for that
When it gets to a integer like 2 it works then continues with 2 untill it gets to 3 and so on idk whats the problem here