Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Cannot set a character's name, lacking permission 4?

I am trying to make a game about the anime "Shingeki no Kyojin". I have some character models for some of the characters and I am trying to make a dev panel where you can switch from 1 character to another. The problem is since i need the character's name to match the players name for other scripts i need to make, if you switch from one character to another, you cant switch back to the one you first selected. I dont even know how to fix this.

Srry if the script is bad i've been scripting for about 1 year 4 months now.

local CharacterEvents = game.ReplicatedStorage.CharacterEvents
local Characters = game.ReplicatedStorage.Characters

local ErenModel = Characters.Eren:Clone()
local ArminModel = Characters.Armin:Clone()

CharacterEvents.Eren.OnServerEvent:Connect(function(player)
	
	local PlayerPos = workspace:WaitForChild(player.Name):GetPrimaryPartCFrame()
	
	ErenModel.Name = player.Name
	player.Character = ErenModel
	ErenModel.Parent = workspace
	ErenModel:SetPrimaryPartCFrame(PlayerPos)
end)

CharacterEvents.Armin.OnServerEvent:Connect(function(player)
	local PlayerPos = workspace:WaitForChild(player.Name):GetPrimaryPartCFrame()
	
	ArminModel.Name = player.Name
	player.Character = ArminModel
	ArminModel.Parent = workspace
	ArminModel:SetPrimaryPartCFrame(PlayerPos)
end)

3 comments

0

You are attempting to make the player with your character which is not correct, you should like parent all pieces of erenmodel to character of player.

0

dont forget to remove the old pieces of the player character

0

???

1 answer

Well, I don't understand what did you mean but try to instead of trying changing the name of the player change DisplayName, I am not certain that it will work out but it's worth a try I guess

This discussion is preserved as it was. New answers, comments, and votes are closed.