Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.PlayerAdded:Connect(function(plr)
- local leaderstats = Instance.new("Folder", plr)
- leaderstats.Name = "leaderstats"
- local coins = Instance.new("NumberValue", leaderstats)
- coins.Name = "Coins"
- coins.Value = 0
- local RS = game:GetService("ReplicatedStorage")
- local spawnEv = RS.Events.GUI.CoinSpawnEvent
- local coin = workspace.Coin
- local one = "-9.583, 0.044, 2.421"
- local second = "-17.37, 0.044, 2.798"
- spawnEv.OnServerEvent:Connect(function(player, _)
- local X = math.random(-17.37, -9.583)
- local Y = 0.044
- local Z = math.random(-0.035, 5.2)
- local cl = coin:Clone()
- cl.Parent = workspace
- cl.Name = "SpawnedCoin"
- cl.Position = Vector3.new(X, Y, Z)
- local cl2 = game.ServerScriptService.valAdd:Clone()
- cl2.Parent = cl
- cl2.Enabled = true
- end)
- end)
Add Comment
Please, Sign In to add comment