So instead of player I will put LocalPlayer because I only have a local player variable.
You donât even need to put player because roblox gets it for you automatically. Thatâs why itâs the first parameter no matter what.
This should work
FireClient: player argument must be a Player object still getting this error
local HTTPService = game:GetService('HttpService')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Players = game:GetService('Players')
local BunnyFolder = workspace:WaitForChild('BunnysFolder')
local ReplicatedModules = require(ReplicatedStorage:WaitForChild('Modules'))
local RemoteModule = ReplicatedModules.RemoteService
local BunnysModule = ReplicatedModules.Bunnys
local SystemsContainer = { }
local Debounce = { }
local BunnyTouchedEvent : RemoteEvent = RemoteModule:GetRemote('BunnyTouched', 'RemoteEvent', false)
local selectedData = nil
local Module = {}
function Module:BunnyStack(BunnyID)
return {
ID = BunnyID,
UUID = HTTPService:GenerateGUID(false)
}
end
--function Module:SetProperties(parent, propertiesTable, name)
--local title = parent:FindFirstChild("Title")
--local icon = parent:FindFirstChild("Icon")
--if icon then
--icon.Image = propertiesTable.Display.Icon
--end
--if title then
-- title.Text = propertiesTable.Display.Title.Text
-- end
--end
local DB = false
function Module:CheckBunnyFromID(BunnyID, BunnyName)
for i, Bunny in pairs(BunnyFolder:GetChildren()) do
if Bunny:IsA('Part') and Bunny.Parent == BunnyFolder then
Bunny.Touched:Connect(function(Hit)
if DB == false then DB = true
local LocalPlayer = Players:GetPlayerFromCharacter(Hit.Parent)
local Interface = LocalPlayer:WaitForChild('PlayerGui'):WaitForChild('Ui_Interface')
local FoundBunnyUI = Interface:WaitForChild('BunnyFound')
local LHUD = Interface:WaitForChild('LHUD')
BunnyTouchedEvent:FireClient(Bunny)
--local selectedConfig = selectedData and BunnysModule:GetItemConfig(selectedData.ID)
-- Module:SetProperties(FoundBunnyUI, BunnyID, BunnyName)
--wait(0.1)
--LHUD.Visible = false
--FoundBunnyUI.Visible = true
--wait(5)
--FoundBunnyUI.Visible = false
--FoundBunnyUI.Icon.Image = 'rbxassetid://4617621496'
--LHUD.Visible = true
DB = false
end
end)
else
warn('Touched Part Not From Bunny Folder')
end
end
end
function Module:Init(otherSystems)
SystemsContainer = otherSystems
end
return Module
Yes, I think this is perfect but you still may want to add a wait if you want a cooldown
But i am still getting an error
FireClient: player argument must be a Player object - Server - MainBunny:50
Stack Begin - Studio
Script âServerScriptService.BunnyHandler.MainBunnyâ, Line 50 - Studio - MainBunny:50
Stack End - Studio
Sorry my bad, you need to put player in the first parameter. Iâm confusing myself lol
So how would I write this? FireClient(LocalPlayer, Bunny)?
Yes, I think that should work.
No more fire client issues testing right now
it works thank you! goodbye have a great day
Yeah, no problem. Have a great day too!