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

Custom hat won't clone into local player?

Code

game.Players.PlayerAdded:connect(function(p) 
	p.Chatted:connect(function(msg)
		msg = msg:lower() 
		if (msg == "ssj") then 
			if (p.Character ~= nil) then
					game.Players.LocalPlayer.Character.gokuhair:Destroy()
							game.ServerStorage.ssjgoku:Clone().Parent = game.Players.LocalPlayer.Character
			end 
		end 
	end) 
end)

game.Players.LocalPlayer.Chracter.gokuhair:Destroy() Works fine but game.ServerStorage.ssjgoku:Clone().Parent = game.Players.LocalPlayer.Chracter doesn't work?

Am I doing something wrong here? If so tell me what I'm doing wrong.

Item tree https://gyazo.com/f4aae72a66fdadcde486abf160fb32bf

2 comments

0

local playerLocal = game:GetService("Players").LocalPlayer local character = playerLocal.Character or playerLocal.CharacterAdded:Wait() if not character or character.Parent == nil then character = playerLocal.CharacterAdded:wait() end game.Players.LocalPlayer.Character.gokuhair:Destroy() local clone = game.ServerStorage.ssjgoku:Clone() clone.Parent = character clone:MakeJoints() clone.Archivable

0

you have to save things well that code is not worth it because that is not well written, you have to save it in a localscript within StarterPack or StarterGui, attentive only lets you run a localscript the StarterPack.

1 answer

✓ Accepted answer

You are referencing the hair parent that is the ServerStorege, remove the Parent.

local playerLocal = game:GetService("Players").LocalPlayer
local character = playerLocal.Character or playerLocal.CharacterAdded:Wait()

if not character or character.Parent == nil then
 character = playerLocal.CharacterAdded:wait()
end
game.Players.LocalPlayer.Character.gokuhair:Destroy()
local clone = game.ServerStorage.ssjgoku:Clone()
clone.Parent = character
clone:MakeJoints()
clone.Archivable = true
	

2 comments

0

Where do I put it in the script tho? I'm a lil confused atm.

0

localscript within StarterPack or StarterGui, attentive only lets you run a localscript the StarterPack.

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