I have a tool in starterpack and inside there a server script. My idea was to get the player from the backpack and then the character, but it errors saying nil or that it's not a valid member of DataModel. I found the player, but I can't use Player.CharacterAdded:Wait() or Player.Character for some reason.
local tool = script.Parent local player = script:FindFirstAncestorWhichIsA("Player") local character = player.Character or player.CharacterAdded:Wait()
both player and character print right, but if I try to parent a model FROM the tool to the character it breaks saying "attempt to index nil with character"
(tool variable is the model)
local tool = script.Parent local player = script:FindFirstAncestorWhichIsA("Player") local character = player.Character or player.CharacterAdded:Wait() print(player) print(character) tool.Parent = character
prints but immediately after it says nil so...
local tool = script.Parent local player = script:FindFirstAncestorWhichIsA("Player") local character = game.Workspace:FindFirstChild(player.Name)