✓ Accepted answer
First of all, you have to unedrtstand that the PlayerAdded event's paramter, that you set as "hi", is not the player inside workspace, in fact that's not even a player. It's a character. You see, player has 2 thingies, a Player object, that you find in the Players section, and that is simply there to show all players in a game and to have local information about the player, such as its name and id... And a Character, which is the model that you find inside workspace, that is the physical form of the player. It's a model, containing all bodypart, the player's humanoid, and many other things, that represent the see-able side of the player. As I said, the PlayerAdded paramater is the player object of the player that joined firing that event, not the character. And you were searching for the character inside workspace, and that's wrong, since you are using "hi" which is the player inside Players. How to do this? Easy, you can do player.Character which refers to the player's character.
Another thing, :FindFirstChild() takes a string as an argument, and hi or hi.Character is an instance, so we would use tostring, which turns any type of value into a string, we would turn an instance to a string. (strings if you dont know are the characters inside "", those are string) this is a string "potato182".
game.Players.PlayerAdded:Connect(function(hi)
local ff = game.Workspace.FF:Clone()
ff.CanCollide = false
ff.Anchored = true
local char = workspace:WaitForChild(tostring(hi.Character))
local hum = char:WaitForChild("HumanoidRootPart")
while true do
ff.CFrame = hum.CFrame
wait()
end
end)
That's it!
1 comment
hi isnt a part of workspace