Hello, I am currently trying to get some code to work client-sided. However, nothing happens in a local script and I'm not sure why.
My code:
local eggs = game.ReplicatedStorage.Eggs local spawns = game.Workspace.EggSpawns local spawn = spawns.EoTS local eots = eggs["Egg of True Skill"] local eggClone = eots:Clone() eggClone.Parent = game.Workspace.SpawnedEggs eggClone.Position = spawn.Position + Vector3.new(0,0.5,0) eggClone.Anchored = false eggClone.Touched:Connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then game.ReplicatedStorage.FoundEgg:FireClient(plr,eggClone.Name) eggClone:destroy() end end)
The issue lies on line 19. You're trying to use FireClient
from a localscript
. A client cannot directly communicate with another client. What you would have to do instead, is to send your data to the sever and let the server forward it to its destination.