Hello! I am AsherPlayzs or Dev_Asher, I am working on a find the markers remake I have almost everything done and i just started working on the badge script. I did not want to make a table with all the badge valeus because i am very bad at that so i decided to put a [String Value] inside every bunny. But it is not working, I am getting no errors or anything.
Here is the script
`local ReplicatedStorage = game:GetService(‘ReplicatedStorage’)
local BadgeService = game:GetService(‘BadgeService’)
local Players = game:GetService(‘Players’)
local BunnyFolder = workspace:WaitForChild(‘BunnysFolder’)
local ReplicatedModules = require(ReplicatedStorage:WaitForChild(‘Modules’))
local SystemsContainer = { }
local Cooldown = { }
local Module = { }
CoolDown = false
function Module:HandleBunny(BunnyName)
for _, Bunny in pairs(BunnyFolder:GetChildren()) do
if Bunny:IsA('Part') and Bunny.Parent == BunnyFolder then
Bunny.Touched:Connect(function(Hit)
if CoolDown == false then CoolDown = true
local LocalPlayer = Players:GetPlayerFromCharacter(Hit.Parent)
local Interface = LocalPlayer.PlayerGui:WaitForChild('Ui_Interface')
local BunnyFoundFrameClone = script:WaitForChild('BunnyFound'):Clone()
local Inventory = Interface:WaitForChild('Inventory')
local Backpack = Inventory.InventoryFrame.Backpack
local LHUD = Interface:WaitForChild('LHUD')
local PlrRemotes = LocalPlayer:WaitForChild('Remotes For: '..LocalPlayer.Name)
local BunnyTouchedEvent = PlrRemotes:WaitForChild('Bunny_Found')
BunnyFoundFrameClone.Parent = LocalPlayer.PlayerGui:WaitForChild('Ui_Interface')
local Badge = Bunny:WaitForChild('Badge').Value
if LocalPlayer then
BunnyTouchedEvent:FireClient(LocalPlayer, Bunny)
BadgeService:AwardBadge(LocalPlayer.UserId, Badge)
end
BunnyFoundFrameClone.Visible = true
LHUD.Visible = false
BunnyFoundFrameClone.Icon.Image = Bunny:WaitForChild('Image').Texture
BunnyFoundFrameClone.Title.Text = Bunny:WaitForChild('Name').Value
BunnyFoundFrameClone.Title.TextColor3 = Bunny:WaitForChild('Color').Value
if LocalPlayer:FindFirstChild('Bunnies') then
if not LocalPlayer.Bunnies:FindFirstChild(Bunny.Name) then
local bunnyValue = Instance.new('BoolValue')
bunnyValue.Name = Bunny.Name
bunnyValue.Parent = LocalPlayer.Bunnies
else
print('ALREADY HAS BUNNY')
end
end
for _, selectedFrame in pairs(Backpack:GetChildren()) do
if selectedFrame:IsA('Frame') then
if selectedFrame.Name == Bunny.Name then
selectedFrame.Icon.ImageColor3 = Color3.fromRGB(255, 255, 255)
end
elseif not selectedFrame:IsA('Frame') then
end
end
wait(2.5)
CoolDown = false
wait(0.1)
BunnyFoundFrameClone.Visible = false
BunnyFoundFrameClone:Destroy()
LHUD.Visible = true
end
end)
else
warn('Touched Part Not From Bunny Folder')
end
end
end
function Module:Init(otherSystems)
SystemsContainer = otherSystems
end
return Module`