So basically my friend was coding a tool for a zombie spawner, it spawns the zombie from replicated storage to the mouse position, but it was not working
heres the local script (it activates a remote function which spawns the zombie)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Event = script:FindFirstChildWhichIsA("RemoteEvent")
Mouse.Button1Down:Connect(function()
local Character = Player.Character
local ThisTool = Character:FindFirstChildWhichIsA("Tool")
if ThisTool ~= nil then
Event:FireServer(Mouse.hit)
end
end)
serverside script:
local RemoteEvent = script.Parent:FindFirstChildWhichIsA("RemoteEvent")
local RepSt = game.ReplicatedStorage
local Zombie = RepSt:FindFirstChild("Zombie")
RemoteEvent.OnServerEvent:Connect(function(mousehit)
print("work")
local ZombieMinion = Zombie:Clone()
local Root = ZombieMinion.PrimaryPart
Root.Position = Vector3.new(mousehit)
end)