Hi, i got some problems with the badges. The system that award the badge don’t work in the script i made.
The badge don’t get awarded by the player when the ball and the player are inside the part.
The problem isn’t collision i already tried and it works . Its just the badge awarding system that just don’t work somehow.
local zone = script.Parent
local BadgeService = game:GetService("BadgeService")
local part = script.Parent
local ball = game.Workspace:WaitForChild("ball")
local Players = game:GetService("Players")
local BadgeId = 2153838787 -- Replace 0 with your badge ID.
part.Touched:connect(function(hit)
print("hit")
print(hit)
if ball:IsA("Model") then
if hit.Parent:FindFirstChild("Humanoid") then
local Player = Players:GetPlayerFromCharacter(hit.Parent)
if BadgeService:UserHasBadgeAsync(Player.UserId, BadgeId) == false then
BadgeService:AwardBadge(Player.UserId, BadgeId)
end
end
end
end)
local zone = script.Parent
local BadgeService = game:GetService("BadgeService")
local part = script.Parent
local ball = game.Workspace:WaitForChild("ball")
local Players = game:GetService("Players")
local BadgeId = 2153838787
part.Touched:Connect(function(hit)
print("hit")
print(hit)
if ball:IsA("Model") then
if hit.Parent:FindFirstChild("Humanoid") then
local Player = Players:GetPlayerFromCharacter(hit.Parent)
if BadgeService:UserHasBadgeAsync(Player.UserId, BadgeId) == false then
BadgeService:AwardBadge(Player.UserId, BadgeId)
end
end
end
end)
Make sure the part zone that triggers the badge award is set up correctly and its name matches the one in your script.