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

When you touch a part it gives you one point, but it’s only one time use?

Asked by 3 years ago
Edited 3 years ago

Hey yall! I am trying to make it when you touch a part it adds a point, but when you touch it again it won’t. I have the leaderstats script already (the IntValue is called ‘Wins’). Thank you in advance

-JaisonDXYX

0
I might try boolvalues! If that will work I will take this post down thank you advance! jaisonDXYX 24 — 3y
0
You will want to change the answer to the same thing but the player.leaderstats.Wins to player.leaderstats.Wins += 1 User#39520 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

try this

local part = put the part path here
_G.touched = false

part.Touched:Connect(function(hit)
    if not _G.touched and hit.Parent:FindFirstChild("Humanoid") then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        player.leaderstats.Wins = 1
    end
end)

if it still doesn't work then please dm me at

Blue Duck#8344

0
Mine is JDev#4583 jaisonDXYX 24 — 3y
0
No sadly =. : jaisonDXYX 24 — 3y
Ad

Answer this question