I converted to roblox luau after using python for a while. I followed BrawlDev's beginner series all teh way to the end. But now whenever I touch the coin, I gain more than 1 coin in the coin.value, I have not added a math.random value yet. Here are the scripts
server script under coin in workspace
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = leaderstats
local coin = game.Workspace:FindFirstChild("coin")
coin.Touched:Connect(function(otherpart)
local player = game.Players:GetPlayerFromCharacter(otherpart.Parent)
local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
if humanoid and player then
player.leaderstats.Coins.Value += 1
coin.CanTouch = false
coin.Transparency = 0.9
end
end)
end)
Server script in coin2 under workspace
local coin = game.Workspace:FindFirstChild("coin2")
coin.Touched:Connect(function(otherpart)
local player = game.Players:GetPlayerFromCharacter(otherpart.Parent)
local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
if humanoid and player then
player.leaderstats.Coins.Value += 1
coin.CanTouch = false
coin.Transparency = 0.9
end
end)
please help 😭
** You are now Level 2! **




