|
| 26 Sep 2011 10:48 AM |
I added a gun in a giver and added the giver script. Putting it outside of the gun doesn't work. It just turns the player upsidedown. Here's the script: local debounce = false
function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.Backpack
wait(2) debounce = false end end
script.Parent.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
| |
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
|
| 26 Sep 2011 10:53 AM |
| It is nside the gun and it turns the player upsidedown |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 10:53 AM |
| To the tool not the handle |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 10:54 AM |
Uh (latepostsry) If it makes player upside down then the handle is anchored
just add
script.Parent.Handle.Anchored = false |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 10:55 AM |
| Its in the handle. I try that script part |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 10:57 AM |
| Imean its in the tool not hanlde. I mgunna test the game now since i added the code |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 10:59 AM |
| It kinda wors but the Secound handle isn't showing. It looks like a cup |
|
|
| Report Abuse |
|
|
| |
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 11:01 AM |
| You have more than one handle in it?, if so unanchor them all in the script |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 11:03 AM |
| script.Parent.Handle2.Anchored = false |
|
|
| Report Abuse |
|
|
| |
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 11:04 AM |
| If the handle's name is Handle2, then yes. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 11:10 AM |
| That doesn't work with the secound handle. It's invisble or maybe I should leave it like that? I make a topic about the gun problem in 1:00 PM |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 11:12 AM |
| If you dont need the other handles you can just delete them.. but i think it has welds? (Or should have), And i think when the welds parent's parent is changed the weld with auto remove? |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 11:20 AM |
| Yeah, it has 2 welds, I got them from the Roblox wiki |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2011 11:22 AM |
| BTW. The pistol doesn't kill since I have trouble with the shooting scripts |
|
|
| Report Abuse |
|
|
| |
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 26 Sep 2011 11:31 AM |
| You have to make extra script for Equipped to remake the welds |
|
|
| Report Abuse |
|
|