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

How do I get the script to identify any and all players, and place the plumbob above their heads?

Asked by 7 years ago
local player = game.Workspace:WaitForChild(Head) --2ND problem, It's throwing an error saying global value 'Head' unknown (it was :FindFirstChild(Head) I changed it to see if this would work, but to no avail
local plumbob = script.Parent
local playerpos = player.Position -- I'm getting the Head's position and add (0,+2,0) to the y coord to make the plumbob float 'above' the player's head.
while true do


    plumbob.Position = Vector3.new(playerpos.X), (playerpos.Y + 2), (playerpos.Z) 
    wait(.1)

end

1 answer

Log in to vote
0
Answered by 7 years ago

Hey macabe55101,

I would iterate through all the players, and clone the plumbob for all of them. Then I would place the plumbob inside of each player's Character so that if they are in first person mode, they can't see it just to make it look more realistic. Then, I would do a coroutine.wrap() function for all of the players in the for each iteration that I will use to iterate through all of them and inside of that, I would do a RenderStepped function from RunService. I am not going to code this for you but, I should you how I would do it now, it's your job to use your beautiful creative imagination to figure this out. I will link all of what I talked about below. I hope you have a great day/night.

For each iteration (Roblox calls this a 'Generic For Iteration')

Coroutines

RenderStepped Example.

~~ KingLoneCat

Ad

Answer this question