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: Extreme scripter needed... (+A Question)

Previous Thread :: Next Thread 
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 01:50 PM
The Question - How would I make something that only works in a certain area?

What I need an 'extreme' scripter for;
I need a player of a certain team to be able to pick up blocks when pointing at them with the mouse, and holding down a button. So far i've asked about 5 people for help on this, yet none of them seemed to be advanced enough.

Thanks in advance :P


Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 02:01 PM
b


Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 02:25 PM
b1


Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
21 Mar 2017 02:26 PM
Yeah haha no


Raycasting and run.RenderStepped
Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 02:27 PM
No wut? :/


Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 02:37 PM
b2


Report Abuse
SpeedyJZoel is not online. SpeedyJZoel
Joined: 16 Aug 2010
Total Posts: 2416
21 Mar 2017 02:41 PM
You will never learn more than learning to do it yourself.
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:52 PM
raycasting is ur best bet
http://wiki.roblox.com/index.php?title=Ray

infact theres a bit of code that fits ur worries perfectly
checks if mouse intersects sphere

if intersectsSphere(mouse.UnitRay, sphere.Position, sphere.Size.X/2) then
-- handle collision
end


takes a while to learn but hey dat how scripting is


are you not ENTERTAINED!??!
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
21 Mar 2017 02:55 PM
Raycasting isnt necessary, just use mouse.hit.p and magnitudes, im sure a magnitude check would be far more efficient than raycasting

local SuperPart = Instance.new("Egg")
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
21 Mar 2017 03:00 PM
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.MouseMoved:connect(function()
if mouse.Target and mouse.Target.Name == "That Block" then
print"Ok joe, we can pick up this block."
end
end)
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 03:10 PM
"Ok joe, we can pick up this block."


are you not ENTERTAINED!??!
Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 03:42 PM
Thanks for the help on the second question, though would still like an answer for the first one.
"How would I make something that only works in a certain area?"


Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
21 Mar 2017 03:45 PM
It depends on how you determine the allowed area. Is it a cube area, circular area, or any other shape? Is it a hard-coded area, or does this area move with some object within the game?

Can you give an example of what you're looking for?
Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 03:51 PM
Just a square map.
The only thing I could think of was putting a block which covers the whole area, making it transparent and unselect cancollide, and use the touching event.
Btw nobody mentioned how to actually make the part follow the mouse.



Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
21 Mar 2017 03:56 PM
Since it is a square map, I recommend using Region3 detection.

http://wiki.roblox.com/index.php?title=API:Region3


To get the position of the mouse pointer, use mouse.Hit.p for a Vector3, or mouse.Hit for a CFrame.
Report Abuse
Dralian is online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
21 Mar 2017 03:57 PM
'nobody told me how to move it with the mouse'
not gonna tell u everything m8

also, no u dont need to use the touched brick thing thats eh. just take a side of the map, maybe put a part over it, take its position, and check the magnitude of the player to the part or w/e ur doing to see if it's able to move. if that makes sense. idk specifics for what you're doing sry.
Report Abuse
Dralian is online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
21 Mar 2017 03:57 PM
that one of the more simplistic ways i can think of
Report Abuse
Klighter is online. Klighter
Joined: 04 Jan 2015
Total Posts: 234
21 Mar 2017 04:02 PM
Actually, I had already worked out how to get the part, but not how to actually move it with the mouse, which is the most 'complicated' part of this code.


Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 05:51 PM
i dunno if this will work. just suggestion

- unanchor brick you're 'grabbing'
- weld to end of tool to drag it?


are you not ENTERTAINED!??!
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