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

How could I make this part spawn near the player and not above?

Asked by 10 years ago

Everytime I click it spawns above the player,I wan't to spawn the near the player,how would I do that?

---------------Vairbles---------------
local Tool = script.Parent
local Handle = script.Parent.Handle
local Player = game.Players.LocalPlayer--Gets LocalPlayer(which is the player with tool or script)
local PlayersMouse = Player:GetMouse()--Gets the Players mouse with the GetMouse() method
local Clicked = false
----------------EquipedEvent-------------
    Tool.Equipped:connect(function(Mouse)
        ---------------------Button1Down---------------------------------
        Mouse.Button1Down:connect(function()--When the player press the right button(Button1) it will do the thing below
            Mouse.Icon  = "http://www.roblox.com/asset/?id=13890082"--Changes the crusor Icon to a plus sign
        Handle.BrickColor = BrickColor.new("Bright green")
                Clicked = true
                if  Clicked == true
                    then
                    local Part = Instance.new("Part",game.Workspace)
                        Mouse.Move:connect(function()
                            Part.CFrame = CFrame.new(Mouse.Origin.p)    
                            end)

            end
            end)          
            --------------------Button1Up---------------------------------
            Mouse.Button1Up:connect(function()--When the player releases the right button(Button1) it will do the thing below
--              local Part = Instance.new("Part",game.workspace)
--                        Part.Anchored = true
--                          Part.CFrame = CFrame.new(Mouse.Hit.p)    
                Mouse.Icon = ""--Changes the crusor icon back to normal
                Handle.BrickColor = BrickColor.new ("Bright red")
                ------------------------------------------------------------
            end)
    end)



1 answer

Log in to vote
1
Answered by 10 years ago

Try setting the brick's spawn location next to the wherever the player spawns. Use (0,0,0) except set the location you want.

0
Example please? kevinnight45 550 — 10y
0
Well, you'll need to find the coordinates next to the spawn. Laserpenguin12 85 — 10y
Ad

Answer this question