#Touch Counter ( SOLVED )
34 messages · Page 1 of 1 (latest)
Youre using game.StarterGui to modify the text
StarterGui is for cloning the gui into the player's special PlayerGui container
The only way to change the current player's gui from another script is with Player.PlayerGui
Heres what I mean:
local Player = game:GetService("Players").LocalPlayer
local BadgeAwarders = script.Parent
local BadgeAwarded = Player.PlayerGui.BadgeRateUI.BadgeAwarded
local BadgeAwardedNumber = 0
local function updateCounter()
BadgeAwardedNumber = BadgeAwardedNumber + 1
BadgeAwarded.Text = tostring(BadgeAwardedNumber)
end
for _, object in pairs(BadgeAwarders:GetChildren()) do
if object:IsA("BasePart") then
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
updateCounter()
end
end)
end
end
Try this out
c
** You are now Level 6! **
Um
Already found the issue
LocalScripts dont run if they are in workspace 💀
Put GUIManager in the actual gui
it works?
lmao
no problem
Korbloxster
However, heres an issue
If you collect one badge and just keep touching the same badge part the counter still goes up
Alright
Just sayin
um
** You are now Level 6! **