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)

4 comments
You can't use local script for touch event
yes you can.
From what I know you can't FireClient from local script, only FireServer
https://scriptinghelpers.org/questions/30320/can-touched-events-work-in-local-scripts