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

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

Asked by
3wdo 198
3 years ago
Edited 3 years ago

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)
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. antoniorigo4 117 — 3y
0
dont forget to remove the old pieces of the player character antoniorigo4 117 — 3y
0
??? 3wdo 198 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question