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
if Player.leaderstats.Rank.Value == "Security Cadet" then
- Script located in StarterCharacterScripts
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
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
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.
So I would move this to the ServerScriptService.
Well, now I spawn with it however it next second, for some reason it respawns again and then I lose the morph but not the itens.
It might be because you parent the character model to the workspace then call LoadCharacter.
Try just keeping the loadCharacter.
Still not, for some reason it commits same problem, now it doesn’t even show the morph for an second.
You could try the other way around.
If that doesn’t work, then you will need to parent the morph to the StarterPlayer folder for LoadCharacter to work.
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)
Nevermind, I removed > player:LoadCharacter()
And now this works.
Thanks for helping me.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.