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

Please Help With this. How do I make a startercharacter team Character?

Asked by
Lakodex 711 Moderation Voter
4 years ago

I've Tried already asking and the guy did not reply to "Why is LoadCharacter Not Working?"

I've Searched the whole site and I cannot find my answer, I've even tried asking my friend "ademyst" BTW the scripter of "HMM..." and hes on do not disturb at the moment on discord so its kinda hard to ask him. I really want to make a black ops type game instead Its SCP Black ops. I just cannot find a way to do it witch did not work

MY SCRIPT:

local player = game.Players.LocalPlayer

if player.Team == game.Teams.Chaos then game.Teams.Chaos.StarterCharacter:Clone().Parent = game.StarterPlayer end

( ITS A LOCALSCRIPT INSIDE OF STARTERCHARACTERSCRIPTS )

Please Fix the Script. I'm fairly newish to this type of scripting.

0
You should do the character spawning all on the server. Just have a different character model for each team in ServerStorage or ReplicatedStorage, uncheck Players.CharacterAutoLoads and manually set the player's player.Character to a Clone of the model for their team, then parent it to Workspace.. EmilyBendsSpace 1025 — 4y
0
LoadCharacter() is not needed, that's only for spawning a user's default Roblox avatar. A StarterCharacter should only be used when you want everyone to have the same character. EmilyBendsSpace 1025 — 4y

1 answer

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
4 years ago
Edited 4 years ago
local rs = game.ReplicatedStorage
local attack = rs.Attackers.StarterCharacter:Clone()
local defend = rs.Defenders.StarterCharacter:Clone()
local plr = game.Players.LocalPlayer

if plr.Team == game.Teams.defend then
    plr.Character:Remove()
    plr.Character = defend
    plr.Character.Parent = workspace
elseif plr.Team == game.Teams.attack then
    plr.Character:Remove()
    plr.Character = attack
    plr.Character.Parent = workspace
end

I Created this. it works, But It keeps respawning myself when I'm not dead :/

EDIT: Fixed. Forgot about the autocharacter load thing.

Ad

Answer this question