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

I need a variable for position to make the dummy spawn at a player. Please help?

I need a variable for position in roblox

local Dummy = script.Parent
Dummy.Position = Vector3.new(humanoidRootPart.Position)

2 answers

✓ Accepted answer

From your question and code, I will assume you want the Dummy to go to the position of the player.

local Dummy = script.Parent
local HRP = Dummy:WaitForChild("HumanoidRootPart")
local PlayerHRP = --define your players character's HumanoidRootPart

HRP.Position = PlayerHRP.Position --you don't need Vector3.new

From your question I think you mean you want a variable for a dummy's spawn location and that you want it to be IN a random player.

local function selectplayer()
    players = game.Players:GetPlayers()
    selected = players[math.random(1,#players)]
    return selected
end

local randomplayer = selectplayers()

local randomposition = randomplayer.Character.HumanoidRootPart.Position

or

local players = game.Players:GetPlayers()

local randomposition = players[math.random(1,#players)].Character.HumanoidRootPart.Position

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