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: So how do developers allow players to place houses

Previous Thread :: Next Thread 
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
13 Jun 2015 07:41 AM
Its kinda hard to explain

You know how in games like sandbox or build to survive _, when you select something you can see a faded version of it until you place it?

That's what Im trying to replicate. Survival games I think also do it (actually they're a better example).

If you need better explination then ask in the comments
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Jun 2015 08:05 AM
clone the House from say ServerStorage or whatever, loop through the Children and set all of the Part's Transparency to .5 or something, then when u click set it to 0 :P
simple...

"My Life is going Good... but..."
Report Abuse
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
13 Jun 2015 08:09 AM
but how can you make the model follow the mouse?

Im stuck on using the mousemove function...
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Jun 2015 08:17 AM
Mouse.Move:connect(function()
HouseModel:MoveTo(Mouse.Hit.p)
end)

"My Life is going Good... but..."
Report Abuse
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
13 Jun 2015 08:50 AM
So this is what I have so far (The script is located in game.starterGUI.screenGUI.TextButton), and it is a local script.

script.Parent.MouseButton1Click:connect(function()
game.Workspace.BrickHouse:Clone()
for i, v in pairs (game.Workspace.BrickHouse:GetChildren()) do
v.Transparency = 0.5
v.CanCollide = false
Mouse.Move:connect(function()
game.Workspace.BrickHouse:MoveTo(Mouse.Hit.p)
end)
end
end)

It keeps saying however that mouse is an unknown global. I feel im missing the obvious.
Report Abuse
XanthusMuciusNero is not online. XanthusMuciusNero
Joined: 11 Jul 2010
Total Posts: 776
13 Jun 2015 08:54 AM
You have to define Mouse
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Jun 2015 08:58 AM
^

"My Life is going Good... but..."
Report Abuse
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
13 Jun 2015 09:09 AM
Ok so I got the main objective of the script working - it does clone the house and follow the mouse.

But it is very, very laggy, and it doesnt seem to make the parts in the house transparent. Should I define the cloned house and use waitforchild to wait until all the parts are transparent before it follows the player's mouse?
Report Abuse
jordanNin64 is not online. jordanNin64
Joined: 07 Jun 2013
Total Posts: 2457
13 Jun 2015 09:10 AM
Here's the script

script.Parent.MouseButton1Click:connect(function()
game.Workspace.BrickHouse:Clone()
for i, v in pairs (game.Workspace.BrickHouse:GetChildren()) do
v.Transparency = 0.5
v.CanCollide = false
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
Mouse.Move:connect(function()
game.Workspace.BrickHouse:MoveTo(Mouse.Hit.p)
end)
end
end)

Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Jun 2015 09:17 AM
if v:IsA('BasePart') then
v.Transparency = .5
end

and also, u don't have to define player and mouse inside script.Parent.MouseButton1Click :P

also, for the laggy part, I might make a function soon, to kinda smoothly move a Model to the targetPosition (with a slight delay, cos of the smoothness, ya know)

"My Life is going Good... but..."
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