Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make If Player Is in A Team It Will morph That player With A morph Mesh/Character?

Asked by 2 years ago
Edited 2 years ago

When A Player is in enemy team it automatically morphs the player to a team morph That can be seen by Other Players Client Too, How do I do that? And Where do I Put It?

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

You can use Remote Events

Firstly, make a remote event instance in replicated, then name it "morphTo", we fire it and provide the team name

local morphTo = game:GetService('ReplicatedStorage').morphTo

morphTo:FireServer(player.Team.Name)

Second, make a server script and parent it to server script service and define 2 variables as its morphs

local redMorph = -- link those to the morph characters, you can rename the variables to whatever you want
local blueMorph = 

local morphTo = game:GetService('ReplicatedStorage').morphTo

morphTo.OnServerEvent:Connect(function(player, team)
    if team == 'red' then
        local cloned = redMorph:Clone()
        cloned.Parent = workspace

        player.Character = cloned
        player:LoadCharacter()
    else
        local cloned = blueMorph:Clone()
        cloned.Parent = workspace

        player.Character = cloned
        player:LoadCharacter()
    end
end)
0
Sorry, But Im New to Scripting Where do i Put local morphTo = game:GetService('ReplicatedStorage').morphTo morphTo:FireServer(player.Team.Name)? MOJANGcreator091 60 — 2y
0
Localscript, PlayerScriptsService azakmi_uui2 60 — 2y
0
and if you want to set the player character to the morph upon joining, wrap it around an Players.PlayerAdded event azakmi_uui2 60 — 2y
0
with a player parameter azakmi_uui2 60 — 2y
0
Thx MOJANGcreator091 60 — 2y
Ad

Answer this question