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 2 years ago
Edited 2 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 — 2y
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 — 2y

1 answer

Log in to vote
0
Answered by 2 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 — 2y
0
No sadly =. : jaisonDXYX 24 — 2y
Ad

Answer this question