SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:04 PM |
I was wanting to make a tool that would allow one player to pick up another player.
The player with the tool (source), clicks on the player to hold (target)
if player1 is the source and player2 is the target, it works, i weld player2 to the torso of player1, and everything works perfectly
so then i try to have player2 be source, and player1 be target, but the weld, is making player2 'move to' player1, and player2 essentially is stuck, as though anchored.
I read that using welds, Part0 is moved to Part1, well in this case, the target is always part0, and source is part1, so it should always be moving the target to the source.
So, has anyone else had issues with welding players? or know of a better way to 'carry' or 'hold' a player?
I think maybe the issue is with roblox knowing that they are both 'players' both controlled by a user, and maybe that is the issue, is there a way to temporarily 'unhook' the character from the player without killing the player?
Idk, im grasping at straws here, any help is appreciated.
|
|
|
| Report Abuse |
|
|
Link5659
|
  |
| Joined: 04 Jun 2012 |
| Total Posts: 4525 |
|
|
| 14 Sep 2015 09:06 PM |
| Have we even tried this? Is a better question. |
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:16 PM |
I'm not sure I understand what you mean by 'have we even tried this' ? You mean has anyone else ever tried this? And to that ... I dont know, I would think someone, somewhere has wanted one player to pick up, or carry or somehow hold another.
I have tried it, thus I am having to ask for a solution, because its not working correctly. |
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:27 PM |
Its really strange....
its like this...
player1 picks up player2 -- works fine
player2 picks up player1 -- FAIL
player2 reset character
player2 picks up player1 -- works fine
its almost seems like when player1 picks up player2 , its remembers player2 is the part to move towards player1
so then later when player2 picks up player1, its still trying to use what it rememberd, and have player2 move towards player1, which doesnt work, should be the opposite |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 14 Sep 2015 09:29 PM |
yeah I used to weld everyone to me for fun
it might do justice to disconnect the player who's getting picked up's controls (basically what you were guessing towards). |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2015 09:29 PM |
| Do you mind posting the code? |
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:33 PM |
I dont know if there are any keywords or flags i need to add to the post to make the code look better in here, but here it is, pretty simple.
Also, what would I search under, to discover how to disconnect control from a player?
function onHandleTouched(part) if part:IsDescendantOf(Tool.Parent) then return end if not AttackDamaging then return end print("hit") if part.Parent and part.Parent:FindFirstChild("Humanoid") then print("hit player") local human = part.Parent.Humanoid local target = human.Parent local character = Tool.Parent if not target:FindFirstChild("BeingHeld") and not target:FindFirstChild("Holding") and not character:FindFirstChild("Holding")and not character:FindFirstChild("BeingHeld") then --Instance.new("Weld",target).Name = "BeingHeld" Instance.new("ObjectValue",character).Name = "Holding"
local NewWeld = Instance.new("Weld") NewWeld.Part0 = target.Torso NewWeld.Part1 = Handle--character.Torso; NewWeld.C0 = CFrame.new(-1,0,0) * CFrame.Angles(0,math.rad(-90),math.rad(45))--CFrame.new(); NewWeld.C1 = CFrame.new() --CFrame.new(0,0,-1) * CFrame.Angles(math.rad(90),math.rad(45),math.rad(-90)) NewWeld.Name = "BeingHeld" NewWeld.Parent = target
character.Holding.Value = target
human.Sit = true --local weld = target.BeingHeld --weld.Part0 = character.Torso --weld.Part1 = target.Torso --weld.C1 = CFrame.new(-1,0,0) * CFrame.Angles(0,math.rad(-90),math.rad(45)) --weld.Part1 = character.HumanoidRootPart --weld.Part0 = target.HumanoidRootPart --131.331, -0.002, -179.997 --weld.C1 = CFrame.new(0,0,-1) * CFrame.Angles(math.rad(90),math.rad(45),math.rad(-90)) local para = Tool.Parasite:Clone() para.Parent = target.Humanoid para.Disabled = false end end end |
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:34 PM |
if you notice in the code i was attaching to the Torso, but to try different things, i tried attaching to Handle, which is just a simple block representing the 'hold' tool
Ive also tried switching the CFrames, and Parts around, still, same results
|
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 14 Sep 2015 09:48 PM |
here is the test site to see what I'm talking about
http://www.roblox.com/games/292346590/Test-Server-M-PSL
After you have been held, you can not hold anyone else correctly, until you reset character |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 14 Sep 2015 09:54 PM |
| http://wiki.roblox.com/index.php?title=Controlling_a_Player%27s_Character |
|
|
| Report Abuse |
|
|
SelDraken
|
  |
| Joined: 10 Jul 2010 |
| Total Posts: 77 |
|
|
| 15 Sep 2015 01:35 PM |
| Problem solved. Thanks so much to all who helped, it was the HumanoidRootPart that was causing the problems. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 15 Sep 2015 02:17 PM |
I didn't read it, but I was going to suggest setting the humanoid state to Physics http://wiki.roblox.com/index.php?title=API:Enum/HumanoidStateType
-=Robo=- |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Sep 2015 03:40 PM |
Lol yeah, good troll model to weld two players together.
KFC is not kentucky fried chicken |
|
|
| Report Abuse |
|
|
| |
|