Ad
Log in to vote
0

Morph occurs to all players. How do I fix this?

Asked by 3 days ago

I'm making a zombie tag-esque game and I am making the base code for being turned into a zombie. I made a trigger for it and it works with one problem: All people in the server are changed into a zombie. I am doing this server side so other players can see the change by the way.

game.ReplicatedStorage.Transfurs.MPEGoo.OnServerEvent:Connect(function()
    local messyArmL = game.ServerStorage.MessyLimb:Clone()
    local messyArmR = game.ServerStorage.MessyLimb:Clone()
    local messyLegL = game.ServerStorage.MessyLimb:Clone()
    local messyLegR = game.ServerStorage.MessyLimb:Clone()
    local messyTorso = game.ServerStorage.MessyTorso:Clone()
    local Player = script.Parent.Parent
    local Character = Player.Character
    local ArmL = Character["Left Arm"]
    local ArmR = Character["Right Arm"]
    local LegL = Character["Left Leg"]
    local LegR = Character["Right Leg"]
    local Torso = Character["Torso"]

    --Left Arm
    local weldAL = Instance.new("WeldConstraint")
    weldAL.Part0 = ArmL
    weldAL.Part1 = messyArmL
    weldAL.Parent = ArmL
    messyArmL.Position = ArmL.Position
    messyArmL.Orientation = ArmL.Orientation
    messyArmL.Parent = game.Workspace
    messyArmL.Color = Color3.new(1, 1, 1)
    --Right Arm
    local weldRA = Instance.new("WeldConstraint")
    weldRA.Part0 = ArmR
    weldRA.Part1 = messyArmR
    weldRA.Parent = ArmR
    messyArmR.Position = ArmR.Position
    messyArmR.Orientation = ArmR.Orientation
    messyArmR.Parent = game.Workspace
    messyArmR.Color = Color3.new(1, 1, 1)
    --Left Leg
    local weldLL = Instance.new("WeldConstraint")
    weldLL.Part0 = LegL
    weldLL.Part1 = messyLegL
    weldLL.Parent = LegL
    messyLegL.Position = LegL.Position
    messyLegL.Orientation = LegL.Orientation
    messyLegL.Parent = game.Workspace
    messyLegL.Color = Color3.new(1, 1, 1)
    --Right Arm
    local weldRL = Instance.new("WeldConstraint")
    weldRL.Part0 = LegR
    weldRL.Part1 = messyLegR
    weldRL.Parent = LegR
    messyLegR.Position = LegR.Position
    messyLegR.Orientation = LegR.Orientation
    messyLegR.Parent = game.Workspace
    messyLegR.Color = Color3.new(1, 1, 1)
    --Torso
    local weldT = Instance.new("WeldConstraint")
    weldT.Part0 = Torso
    weldT.Part1 = messyTorso
    weldT.Parent = Torso
    messyTorso.Position = Torso.Position
    messyTorso.Orientation = Torso.Orientation
    messyTorso.Parent = game.Workspace
    messyTorso.Color = Color3.new(1, 1, 1)
    --Head
    local NewHead = game.ServerStorage.massproducedgoo:Clone()
    local OldHead = Character.Head
    local headweld = Instance.new("Weld")
    headweld.Parent = game.Workspace
    headweld.Part0 = OldHead
    headweld.Part1 = NewHead.Headroot
    NewHead:MoveTo(OldHead.Position)
    NewHead.Parent = game.Workspace
    OldHead.Color = Color3.new(1, 1, 1)

    messyLegL.Transparency = 1
    messyLegR.Transparency = 1
    messyTorso.Transparency = 1
    messyArmL.Transparency = 1
    messyArmR.Transparency = 1
    wait(0.25)
    messyLegL.Transparency = 0.75
    messyLegR.Transparency = 0.75
    wait(0.25)
    messyLegL.Transparency = 0.5
    messyLegR.Transparency = 0.5
    wait(0.25)
    messyLegL.Transparency = 0.25
    messyLegR.Transparency = 0.25
    wait(0.25)
    messyLegL.Transparency = 0
    messyLegR.Transparency = 0
    wait(0.1)
    messyArmL.Transparency = 0.75
    messyArmR.Transparency = 0.75
    wait(0.25)
    messyArmR.Transparency = 0.5
    messyArmL.Transparency = 0.5
    wait(0.25)
    messyArmR.Transparency = 0.25
    messyArmL.Transparency = 0.25
    wait(0.25)
    messyTorso.Transparency = 1
    wait(0.1)
    messyTorso.Transparency = 0.75
    wait(0.25)
    messyTorso.Transparency = 0.5
    wait(0.25)
    messyTorso.Transparency = 0.25
    wait(0.25)
    messyTorso.Transparency = 0
end)

Answer this question