I am trying to make a script that makes your character have a custom by clicking on a Gui button, the problem is that it spawns with the proposed items but not with the morphs.
LocalScript located in TextButton (Gui)
local Player = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if Player.leaderstats.Rank.Value == "Security Cadet" then
game.ReplicatedStorage.Event.Morpher:FireServer("Cadet")
end
end)
Script located in StarterCharacterScripts
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.ReplicatedStorage.Event.Morpher.OnServerEvent:Connect(function(player, rankName)
if rankName == "Cadet" then
local Morph = ServerStorage.Morph.SED.Morphs.Security1Guard:Clone()
local L2 = ServerStorage.Itens["[NC] Level-2"]:Clone()
local LC = ServerStorage.Itens["[NC] Level-C"]:Clone()
local Beretta = ServerStorage.Itens["Beretta 92fs"]:Clone()
local Radio = ServerStorage.Itens.Radio:Clone()
Morph.Name = "StarterCharacter"
player.Character = Morph
player.Character.Parent = workspace
player:LoadCharacter()
L2.Parent = player.Backpack
LC.Parent = player.Backpack
Beretta.Parent = player.Backpack
Radio.Parent = player.Backpack
I assume your second script is a server script so it needs to be in ServerScriptService or Workspace to run.
However, If the character has not yet spawned, the character model won’t be in workspace, the script won’t be available and won’t be able to run.
That was also another problem, it was inicially to the StarterPlayer, however, supossing to be only for me, it morphed for everyone in the same server and also for the people who joined the server would receive the morph. (This only happening if the first person morphs himself)