Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Click tool That gives money Stats? [closed]

Asked by 7 years ago

I need A tool that gives money on click... or script?

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?

1 answer

Log in to vote
0
Answered by 7 years ago

Here is a script you can insert into a part. When a player touches the part, they will get the leaderstats (Money).

01local ting = 0 --debouncer
02 
03function 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
View all 27 lines...
Ad