New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to reward players with a badge? [Solved]

Asked by 14 days ago
Edited by Feahren 14 days ago

How do i rewards players when time they reach a time limit? (there is a time limit, and it works.)

ERROR: "userId is not a valid member of Part"

local Boards = workspace.Keycard
local door = workspace.Door
local WALL = workspace.BlahBlah
local LOL = workspace.Block




script.Parent.Touched:connect(function(p)
local o = game.Players:GetPlayerFromCharacter(p.Parent)
if p.Parent.Name == "Card" ~= nil then
--insert code here
print("Awarding BadgeID: " ..script.Parent.BadgeID.Value .. " to UserID: " .. p.userId)
local b = game:GetService("BadgeService")
b:AwardBadge(p.userId, script.Parent.BadgeID.Value)
wait(2)
workspace.RIP:Stop()
for _,v in pairs(game.Players:GetPlayers()) do
if v:IsA("Player") then
v:Kick("Goodbye Loser")
end 
end
end
end)

Answer this question