local settengs = script.Settings
--Identified the folder containing our stats
local yPoints1 = settengs.Stat01.Value
local amount1 = settengs.Stat01Amount.Value
local waittime = settengs.WaitTime.Value
--Identified the stats
local ting = 0
--Debouncer
function OnTouch(Touched)
(script.Parent.Touched:connect(OnTouch)
if ting == 0 then
ting = 1
local Touchy = Touched.Parent:FindFirstChild("Humanoid")
if Touchy ~= nil then --If the toucher is a humanoid then proceed
local Player = game.Players:GetPlayerFromCharacter(Touched.Parent)
local stats = Player:findFirstChild("leaderstats")
if stats ~= nil then
local StatToIncrease = stats:findFirstChild(yPoints1) -
StatToIncrease.Value = StatToIncrease.Value +amount1
wait(waittime)
print(":Script executed successfully!")
end
end
ting = 0 --remove debounce
end
end
script.Parent.Touched:connect(OnTouch)
That gives you the point if you stand on it but i want it so when you shoot the button (With a projectile) you get the point, Not when you stand on it??

4 comments
(Stand on a button)
Describw the problem in more depth please because how you explainwd seems to be just a variable problem.
Well there is a button and when you stand on it, it gives you points (Thats what this script does) but i need it so when you shoot the button with a gun or laser etc i don't mind (And not stand on it) It gives you the point. This script means when you stand on the button it gives you a point but i want it so when you shoot the button it gives you the point.
Just add a touched event to the projectiles script to check if it touched the button