I need A tool that gives money on click... or script?
Here is a script you can insert into a part. When a player touches the part, they will get the leaderstats (Money).
01 | local ting = 0 --debouncer |
02 |
03 | function onTouched(hit) |
04 |
05 | if ting = = 0 then --debounce check |
06 | ting = 1 --activate debounce |
07 | check = hit.Parent:FindFirstChild( "Humanoid" ) --Find the human that touched the button |
08 |
09 | if check ~ = nil then --If a human is found, then |
10 |
11 | local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human |
12 | local stats = user:findFirstChild( "leaderstats" ) --Find moneyholder |
13 |
14 | if stats ~ = nil then --If moneyholder exists then |
15 | local cash = stats:findFirstChild( "Money" ) --Get money |
Closed as Not Constructive by Thundermaker300, TheeDeathCaster, and Programical
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?