#rebirth badge
1 messages · Page 1 of 1 (latest)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player.PlayerGui
local rebirthButton = playerGui.MainGui.RebirthFrame.RebirthButton
rebirthButton.MouseButton1Click:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local success, HasBadge = pcall(BadgeService.UserHasBadgeAsync, BadgeService, player.UserId, 1158970328657874)
if not success then
print("Failed to check if user has badge")
end
if not HasBadge then
local success, errorMessage = pcall(BadgeService.AwardBadgeAsync, BadgeService, player.UserId, 1158970328657874)
if not success then
print(errorMessage)
end
end
end
end)```
Bc you're on server script
Bc you're on server script
Trying to use local player and detect mouse click
My discord sent twice
is this good?
but idk why badgeservice is underlined now
oh.. BadgeService can't be used on local scripts
then what do i do

fix your indentation
you probably forgot to define badgeservice. i doubt you can award from client but you can probably check localplayer only
I was gonna write that