Hello! The reason I am using a LocalScript in StarterPlayerScripts is because there is a variable I require to be client side that I want to use to enable the player to get the badge. However, the script doesn’t work as it is right now.
local door = game.Workspace:WaitForChild("Door")
local handle = door:WaitForChild("Handle")
local badgeid = 3001013084614617 -- change this as your badge id
local player = game.Players.LocalPlayer
local key2 = game.Workspace:WaitForChild("Key1")
handle.ClickDetector.MouseClick:Connect(function()
if keydoor2 == true then
badgeservice:AwardBadge(player.UserId, badgeid)
wait(1)
player:Kick("DEAD END")
else
handle["Sound"]:Play()
handle.ClickDetector.MaxActivationDistance = 0
wait(1.525)
handle.ClickDetector.MaxActivationDistance = 10
end
end)
Thank you in advance