ok so I made a custom hat and if i place it in StarterCharacterScripts it works and all good, but don't need the hat in there all the time. I was trying to clone it in from ServerStorage with scripts but that didn't work, then I was trying to clone it using server scripts, but that also didn't work can here is the script I made
( Server Script inside Server Script Service )
( Hat is located in ServerStorage)
( I want it to get cloned on the player )
character = game.Players.LocalPlayer hat = game.ServerStorage.RBT a = hat:Clone() a.Parent = character
You cannot call the local Player
from a ServerScript, as it is designed to operate as a Server instruction and not a Client—meaning it doesn’t have a Player Object to link to. You cannot use a LocalScript in this situation either as it is unable to gain access to SeverStorage
due to FE regulations. To solve your issue, use a .PlayerAdded
event to clone to the Hat to each character and Player upon joining.
local ServerStorage = game:GetService("ServerStorage") local Players = game:GetService("Players”) local Hat = ServerStorage:WaitForChild("RBT") Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) Hat:Clone().Parent = Character end) end)
Try put the hat in ServerStorage. Use a local script in StarterPlayer > StarterPlayerScripts and make all of the objects a variable:
local char = game:GetService("Players").LocalPlayer local hat = game:GetService("ServerStorage").RBT local a = hat:Clone() a.Parent = char (and for the head if it is a hat do char.Head)