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

How can I refresh a character so that it takes in consideration the change in StarterPlayer?

Asked by
Zologo 37
6 years ago

Alright so I have 3 character models in my lighting (naruto, luffy and goku).

I want to make a Image Button that when you click it you get ''morphed'' into naruto and then closes the GUI.

This is my code so far.

local naruto = game.Lighting:WaitForChild('Naruto')
local narutoc = naruto:Clone()
local replicatedStorage = game:GetService("ReplicatedStorage")
local respawnEvent = replicatedStorage:WaitForChild("Respawn_Plr")


script.Parent.MouseButton1Click:connect(function()
    narutoc.Name = 'StarterCharacter'
    narutoc.Parent = game.StarterPlayer
    respawnEvent:FireServer()
    script.Parent.Parent : destroy()
end)

So far my script makes a copy of the naruto model from lighting then renames it StarterCharacter and places it under game.StarterPlayer, then it respawns the character and closes the GUI.

The problem is that even though the character respawns it doesnt morph as Naruto can you please help me?

0
I've only read the first sentence, but uh you should use ServerStorage instead of lighting. It's more secure and ServerStorage is for these kinds of things anyway. Optikk 499 — 6y
0
anime crossover! TheluaBanana 946 — 6y
0
I'll transfer my models into ServerStorage then, thank you @Optikk,@TheluaBanana I`m not making an anime crossover game unfortunatly :/ Zologo 37 — 6y
0
@Optikk, when I transfer the models into ServerStorage, it creates a stack and it doesnt work :/ Zologo 37 — 6y

Answer this question