local ting = 0 --debouncer
local mon = script.Parent.Parent.MoneyValue
minstilregen = 2 -- change this to how ever many mins you want it to take before you can use again
tt = minstilregen * 60-- dont change
function onTouched(hit)
if ting == 0 then --debounce check
ting = 1 --activate debounce
check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button
if check ~= nil then --If a human is found, then
local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder
if stats ~= nil then --If moneyholder exists then
local cash = stats:findFirstChild("Money") --Get money
cash.Value = cash.Value + mon.Value
script.Parent.Parent.Name = "Fixed" -- you should change this also
script.Parent.Transparency = 0.8
wait(tt)-- do not change
script.Parent.Parent.Name = "Pay amount: 100" -- change this to the title you want
script.Parent.Transparency = 0.2
end
end
ting = 0 --remove debounce
end
end
script.Parent.Touched:connect(onTouched)
I want to give players of specific teams blocks to touch to gain money but I also don't want players of other teams to come in and touch the bricks for the money. I have a script that will give money on touch and it has a timer to ensure no spam but I can't find where to put the check team part of the script and when I try it will end up breaking most of the script. Any help would be appreciated! So just to clarify I need help adding into my current script a part that checks the humanoid that touched the part's team to make sure that everyone has a fair advantage this is my old script ive got a newer one but i still cant figure out what im doing wrong

7 comments
lol and you expect to be helped without a script
ScriptingHelpers is a community for teaching, we would love you to take a go at the script and we will support you in fixing the issue.
Include your script
Not even a Print Hello World script to start?
^^^ While I understand you are new here, they are right. This site is for problems you are running into with scripts you are working on or have worked on. Unfortunately, we cannot help you without a script. However, you can get started by making a few quick searches. For example, on Touched events and conditional statements.
No script included.
sorry for not posting a script i was at work during the time i posted this and when I made it home i wasnt sure how to post the script but I posted a link to my inventory