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: How to make this function work

Previous Thread :: Next Thread 
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
02 Jan 2012 04:14 PM
local texture = "http://www.roblox.com/asset/?id=63730951"

function giveGun(gun, player)
if player~=nil then
if game.Lighting:findFirstChild(gun) ~= nil then
if player.Backpack:findFirstChild(gun) == nil then
if player.Character:findFirstChild(gun) == nil then
cl = game.Lighting:findFirstChild(gun):clone()
cl.Parent = player.Backpack
end
end
end
end
end

function giveGunsOssimPeople(hit)
if (hit.Parent:findFirstChild("Humanoid") ~=nil) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player~=nil then
if player.Character.Torso.roblox.Texture == texture then
wait(3)
local Sniper = game.Lighting.SUF:clone()
Sniper.Parent = player.Backpack -- Add more guns below this one
end
end
end
end

script.Parent.Touched:connect(giveGunsOssimPeople)



Function Givegun(gun, player) does not work. How will it?
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
02 Jan 2012 04:19 PM
You never defined it as a touch function. Therefore, it won't run unless you call it. I believe simply adding the following line will fix it, unless there is another error somewhere.

script.Parent.Touched:connect(giveGun)
Report Abuse
3lex33 is not online. 3lex33
Joined: 08 Oct 2008
Total Posts: 5220
02 Jan 2012 04:20 PM
When did you apply the function?
Report Abuse
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
02 Jan 2012 04:25 PM
@neon,

would I add it at the end of the script or right below the function?
Report Abuse
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
02 Jan 2012 05:22 PM
?
Report Abuse
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
02 Jan 2012 06:08 PM
Anyone
Report Abuse
C0D3Y is not online. C0D3Y
Joined: 24 Jul 2010
Total Posts: 1692
02 Jan 2012 06:25 PM
local texture = "http://www.roblox.com/asset/?id=63730951"


function giveGunsOssimPeople(hit)
if hit.Parent:findFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player~=nil then
if player.Character.Shirt.Texture == texture then
wait(3)
local Sniper = game.Lighting.SUF:clone(player.Backpack)
end
end
end

script.Parent.Touched:connect(giveGunsOssimPeople)

Try it... This script is untested
Report Abuse
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
02 Jan 2012 07:27 PM
The giveGun function
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