I tried making a currency and a minigame and what is supposed to happen is that if you get first, you would get that currency, but it never works.
local w = game.ServerScriptService.v:FindFirstChild(Wins) local p = 0 if workspace.Parkour.PWalls.Winplat.Touched:Connect(FindFirstChild("Humanoid")) and p < 1 then w = w + 1 p = p + 1 else p = p + 1 end
If anyone could help me, that would be great.
Access the value, not the int itself. When using FindFirstChild the correct syntax is (" "), since you're searching for a name.
local w = game.ServerScriptService.v:FindFirstChild("Wins") local p = 0 if workspace.Parkour.PWalls.Winplat.Touched:Connect(FindFirstChild("Humanoid")) and p < 1 then w.Value = w.Value + 1 p = p + 1 else p = p + 1 end
I think this is what you want though, the if statement will only run once, if you put it into a touched function it will watch for the touch.
local w = game.ServerScriptService.v:FindFirstChild("Wins") local t = FindFirstChild("Humanoid") local p = 0 workspace.Parkour.PWalls.Winplat.Touched:Connect(function(t) if p < 1 then w.Value = w.Value + 1 p = p + 1 else p = p + 1 end end)