generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Placing System

Previous Thread :: Next Thread 
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
18 Jun 2017 09:38 AM
What is needed to make a placing system like in Plaza, Miners Haven, etc?


bamboozled
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 09:51 AM
>Mouse's position
>RenderStepped
>Object
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
18 Jun 2017 10:08 AM
Thank you!


bamboozled
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 10:10 AM
One more thing.

You need to set the mouse's targetfilter to the part which you want to follow the mouse.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
18 Jun 2017 10:12 AM
Already did this and it works

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local run = game:GetService("RunService")
local part = workspace.Part
local placing = true

run.RenderStepped:connect(function()
if placing == true then
if mouse.Target ~= part then
part.CFrame = mouse.Hit
part.Orientation = Vector3.new(0, 0, 0)
part.CanCollide = false
part.Transparency = .5
end
end
end)

mouse.Button1Down:connect(function()
mouse.Button1Up:connect(function()
placing = false
part.CanCollide = true
part.Transparency = 0
end)
end)


I was also trying to find how would I keep the Y position above the ground but the wiki always told me that Y values are readonly :/




bamboozled
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 10:16 AM
You can set the Y like this.

part.CFrame=CFrame.new(mouse.Hit.x,1,mouse.Hit.p.z)
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 10:16 AM
1 is the y axis aka the vertical axis.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
18 Jun 2017 10:18 AM
Thank you so much


bamboozled
Report Abuse
kojocrash is not online. kojocrash
Joined: 07 Sep 2013
Total Posts: 277
18 Jun 2017 10:19 AM
To change the Y axis you need to do Part.Position = Part.Position + Vector3.new(0,y,0)
To set it, it would be Part.Position = Vector3.new(Part.Position.X,0,Part.Position.Z)

Also you might need :SetPrimaryPartCFrame() or something like that
Report Abuse
kojocrash is not online. kojocrash
Joined: 07 Sep 2013
Total Posts: 277
18 Jun 2017 10:20 AM
Or you can replace the Part.Position(The ones after the equal signs) with mouse.Hit.p
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image