So I have this morph event fire whenever the player is hit by the projectile, everything is working fine but it doesn't fire the event? Did I do something wrong cause there are no errors?
Projectile ServerScript
local Projectile = script.Parent
local Heartbeat = game:GetService("RunService").Heartbeat
Projectile.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:IsA('Model') and hit.Parent:FindFirstChild('Humanoid') then
local Player = game:GetService('Players'):GetPlayerFromCharacter(hit.Parent)
print(Player)
local Model = game:GetService('ReplicatedStorage').Morphs.SweetCheeks
local Event = game:GetService('ReplicatedStorage').Events.Morph
print("B4 Fired")
Event:FireClient(Player, Model)
print("Fired")
end
end)
while Heartbeat:wait() do
Projectile.CFrame = CFrame.new(Projectile.Position, Projectile.Position + Projectile.Velocity)
end
Morph Serverscript
local event = game.ReplicatedStorage.Events.Morph
event.OnServerEvent:Connect(function(player, model)
print("Fired")
local Char = model:Clone()
local Pos = player.Character:GetPrimaryPartCFrame()
local Schar = game.StarterPlayer:FindFirstChild("StarterCharacter")
game:GetService("StarterPlayer")
player.Character:Destroy()
player.Character = Char
Char.Parent = workspace
local p = Char:Clone()
p.Parent = game.StarterPlayer
Char:SetPrimaryPartCFrame(Pos)
Schar:Destroy()
end)
