Hi everyone! I want to make a script that give a player a certain number of points, how do I make a command to do that?
ok, so create a script (inside ServerScriptService or Workspace), and write this:
game.Players.PlayerAdded:Connect(function(plr) local lead = Instance.new("Folder", plr) lead.Name = "leaderstats" -- WHEN YOURE MAKING A LEADERBOARD, ALWAYS USE THIS NAME local currency = Instance.new("IntValue", lead) currency.Name = "Points" currency.Value = 100 end)
However, if you're making a part to give you points, also write this in the script:
local part = game.Workspace:WaitForChild:("Part"0 rebounce = false part.Touched:Connect(function(hit) local lead = hit.Parent:WaitForChild("leaderstats") local points = lead:WaitForChild("Points") if lead ~= nil then rebounce = true points.Value = points.Value + 25 wait(3) rebounce = false end end)
Closed as Not Constructive by Shawnyg
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?