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
 

Help with this script Pl0x?

Previous Thread :: Next Thread 
bobbyfishstick5 is not online. bobbyfishstick5
Joined: 24 Oct 2008
Total Posts: 6713
08 Aug 2011 05:46 PM
This script is meant to give anyone who touches the brick a weapon. Its badly wrong. I dont know where though. Thank you in advance.


local debounce = false
Weapon = game.Lighting:findFirstChild"44Caliber"
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

Weapon:clone().Parent = player.Backpack

wait(2)
debounce = false
end
end


script.Parent.Parent.Touched:connect(onTouch)
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
08 Aug 2011 06:14 PM
weapon = game.Lighting["44Caliber"]
local deb = false
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) and not deb then
deb = true
weapon:clone().Parent = game.Players:GetPlayerFromCharacter(hit.Parent).Backpack
wait(2)
deb = false
end
end)
Report Abuse
bobbyfishstick5 is not online. bobbyfishstick5
Joined: 24 Oct 2008
Total Posts: 6713
08 Aug 2011 06:18 PM
Thank you.
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