how do i make it so it checks the username/team of the player and changes their character, im making a scp game and wanted to make it so i have a custom character.
local specialTeam = --team name here
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character
plr:GetPropertyChangedSignal("Team"):Connect(function()
if plr.Team == specialTeam then
local morph = --path to morph
morph.Name = plr.Name
morph.PrimaryPart.CFrame = char.PrimaryPart.CFrame
char = morph
morph.Parent = workspace
end
end)
end)
1 Like
can u also provide the script but for player names
This should be a normal Script in ServerScriptService, also make sure to define the “specialCharacter” variable as the path to the model you want to spawn as.
local specialCharacter = --define Model that you want to spawn as
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "Hizora9" then
local db = false
player.CharacterAdded:Connect(function(char)
if db == false then
db = true
local clone = specialCharacter:Clone()
clone.Parent = workspace
local pastPosition = char.HumanoidRootPart.Position
local past = player.Character
player.Character = clone
clone.PrimaryPart.Position = pastPosition
player.Character = clone
past:Destroy()
wait(1)
db = false
end
end)
end
end)
1 Like
can u provide a script to find the morph from a folder in replicated storage
game.ReplicatedStorage[name of folder].[name of morph]
the .[name of morph] gave me an error saying that [ wasnt supposed to be there
Yes the brackets aren’t supposed to be there they are only supposed to guide you.
Sorry for not responding, I was away. Yes so for example if the morph was named “Bob”, and it was a child of Replicated Storage, then this line:
Would be:
local specialCharacter = game.ReplicatedStorage:WaitForChild("Bob")