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 » Scripting Helpers
Home Search
 

Re: Giver script problem

Previous Thread :: Next Thread 
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 10:50 AM
No one is coming?
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
26 Sep 2011 10:51 AM
[ Content Deleted ]
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 10:53 AM
It is nside the gun and it turns the player upsidedown
Report Abuse
nike6330 is not online. nike6330
Joined: 11 Feb 2009
Total Posts: 154
26 Sep 2011 10:53 AM
To the tool not the handle
Report Abuse
nike6330 is not online. 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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 10:55 AM
Its in the handle. I try that script part
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 10:59 AM
It kinda wors but the Secound handle isn't showing. It looks like a cup
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:00 AM
I mean works, sorry
Report Abuse
nike6330 is not online. 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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:03 AM
script.Parent.Handle2.Anchored = false
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:03 AM
That one?
Report Abuse
nike6330 is not online. 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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
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 is not online. 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
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:20 AM
Yeah, it has 2 welds, I got them from the Roblox wiki
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:22 AM
BTW. The pistol doesn't kill since I have trouble with the shooting scripts
Report Abuse
fanofzteebbee is not online. fanofzteebbee
Joined: 14 Feb 2011
Total Posts: 2047
26 Sep 2011 11:29 AM
Bump
Report Abuse
nike6330 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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