|
| 28 Dec 2013 12:31 AM |
See, the ordinary hopper bin Grab tool let's you take any unlocked part and drag it wherever... But in my place, each player only has control of their own parts, so having a grab tool that lets you move all of the other players' parts isn't very good. See, I have another tool that inserts a part into Workspace, and its name is the player's name, then Part. So, for example, if you were Bob, the name would be "Bob's Part." The script I made lets me move the parts I own, though the problem is that it doesn't move them...correctly. The ordinary move tool slides the part across the surface that the part is over, while this one slowly pulls it into the air if you keep the button down on it. Could you guys help me to figure out how to make it slide across a surface rather than move randomly out of control? Here is the script:
blah = false script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() blah = true print("mouse was pushed down") end) mouse.Button1Up:connect(function() blah = false print("mouse was let up") end) while wait(0.01) do if blah == true then if mouse.Target then if mouse.Target.Name:find("'") then if mouse.Target.Name:sub(1, mouse.Target.Name:find("'")-1) == script.Parent.Parent.Parent.Name then if mouse.Target.Locked == false then mouse.Target.Position = mouse.Hit.p end end end end end end end)
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 12:45 AM |
Wow, Scripting Helpers is really slow after midnight. I guess I'll bump this thread at noon or so. Hopefully I remember.
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 01:00 AM |
There seems to be some activity... I'm going to do one final bump, then go to bed. Hopefully there's a response or two by the time I check after I wake up.
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 01:00 AM |
well uh what i would do but because im really tired, i cant (sorry) is make a ray have the ray ignore the mouse's target, set the target's position to whatever the ray hits, the only problem with this is that the ray hits on the surface of a part, so setting the position to the position the ray hits would put half the block inside the object the ray hits, and half out, there is probably some math that can fix that, but i never really was good with positions and whatnot |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 01:17 AM |
ok.. here's an idea Get the region3 of the object the ray hits get the size of the target which is selected halve the values take the coordinates of the target add and subtract to each dimension of the object's coordinates by the half values check if the coordinates would intercept the region3 this could be a pretty huge offset to where the mouse is point though so you should try and find a more efficient way of doing it |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 06:54 PM |
I'd rather have a more efficient way. I would've bumped this thread earlier, but I decided I'd rather not... But now I do. So let's see....what do you guys think would help? If you have a wiki page or something to help out, please post it. I'm not looking for you to make the script, I just want ideas.
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
travddm
|
  |
| Joined: 29 Mar 2012 |
| Total Posts: 926 |
|
|
| 28 Dec 2013 07:01 PM |
| The reason the target is floating up is because your mouse.Hit.p is the position, on the surface, of your target... I believe that you'd have to make the target locked while you are grabbing it, I am not completely sure though. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 07:14 PM |
@trav, I understand why it's floating up, though locking it would just make it impossible to move, since the while true do loop makes sure it's locked every 0.01 seconds...
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 28 Dec 2013 07:15 PM |
| have you even tried searching for a working drag cool then just modify it |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 07:21 PM |
@thaeh, 1. No 2. I'm making my own script, I just require a well-written idea 3. There already is a HopperBin drag tool, though it can't be modified. I imagine no one would make a free model of something that you can easily acquire through pressing a button in the properties of a HopperBin.
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 07:23 PM |
Wait, yes I have. It was when I first got the idea. I was like, "Man, making a custom drag tool is gonna be challenging, maybe I could find one and change it?" and it just so happened that all I could find were the GameTool and Grab HopperBins .
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 28 Dec 2013 08:49 PM |
i'm pretty sure the game tools are open source. it had something to do with their links used in the linkedsource property of the scripts.
if you search hard enough, you might find the one for the drag tool then just modify it. i'm pretty REALLY sure that the sandbox guy did this. |
|
|
| Report Abuse |
|
|