Hello, devs today i am having an issue with cloning a pet cat. When the player clicks the Equip button on the inv the cat should clone into his character and then everybody in the server can see his cat including himself, but the cat is not cloning in his character I check the client and server side and there is no cat.
Here is a video
LOCAL SCRIPT
local Equip = script.Parent
local InvHandler = game.Players.LocalPlayer.PlayerGui.InventoryHandler
local UpperInv = InvHandler.UpperInv
local MaxPetLimit = UpperInv.MaxPetLimit
local PetLimitText = MaxPetLimit.PetLimitText
local PetPreview = UpperInv.PetPreview
local PetPreviewFrame = PetPreview.PetPreviewFrame
local Im = PetPreviewFrame.PetPreviewImage
-- We just defined all the UI elements
local ReplicatedStorage = game:GetService("ReplicatedStorage")
Equip.MouseButton1Click:Connect(function()
if Im.Image =="rbxassetid://7620353586" then -- Check if its the cat or not
-- added a Value to the max pet limits and make sure to put what pet it is and how much of that pet this will help determine deletions and what to keep
local EquipPet = ReplicatedStorage:WaitForChild("EquipPet") -- check if the remote event is there or not
while EquipPet == nil do wait() end
EquipPet:FireServer()-- Equip pet is the Remote event
print("The Event Fired ")
end
end)
SERVER SCRIPT
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EquipPet = ReplicatedStorage:WaitForChild("EquipPet")
local plr = game.Players.LocalPlayer
local char = game.plr.Character
local humRoot = char:FindFirstChild("HumanoidRootPart")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BasicEggPetFolder = ReplicatedStorage.BasicEggPetFolder
local Cat = BasicEggPetFolder.Cat
local Dog = BasicEggPetFolder.Dog
local Mouse = BasicEggPetFolder.Mouse
local Dragon = BasicEggPetFolder.Dragon
local GrassyCat = BasicEggPetFolder.GrassyCat
local TeaMonster = BasicEggPetFolder.TeaMonster
EquipPet.OnServerEvent:Connect(function()
local Cat = BasicEggPetFolder.Cat
local Clo1 = Cat:Clone()
local StatsValue = Instance.new("StringValue")
StatsValue.Parent = Clo1
StatsValue.Value = "Equipped"
local plr = game.Players.LocalPlayer
local char = plr.Character
Clo1.Parent = char
print(Clo1)
end)
There is no errors in the output. The FireServer actually fire but I don’t know about the server script because the cat did not clone .