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: Siddown script

Previous Thread :: Next Thread 
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
21 Nov 2011 07:09 PM
Supposed to give a tool, but didn't. Tell me what's wrong and what to put in, please.



function onChildAdded(child)
if child.Name == "SeatWeld" then
if child.Part1.Name == "Torso" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player ~= nil then
tool = game.Lighting.Gun:Clone()
tool.Parent = player.Backpack
end
end
end
end

function onChildRemoved()
if tool ~= nil then
tool:Remove()
end
end

script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
Report Abuse
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
21 Nov 2011 07:18 PM
bump
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
21 Nov 2011 07:34 PM
Untested:

local seat = script.Parent
local tool = game.Lighting:FindFirstChild("Gun"):Clone()
local Players = game.Players

seat.ChildAdded:connect(function(child)
    if child.Name == 'SeatWeld' and child:IsA 'Weld' and child.Part0 == seat and child.Part1:IsA 'Part' and child.Part1.Name == "Torso" then
        local player = Players:GetPlayerFromCharacter(child.Parent)
        if player and player:FindFirstChild 'Backpack' then
            tool:Clone().Parent = player.Backpack
        end
    end
end)

seat.ChildRemoved:connect(function(child)
    if child.Name == 'SeatWeld' and child:IsA 'Weld' and child.Part0 == seat and child.Part1:IsA 'Part' and child.Part1.Name == "Torso" then
        local player = Players:GetPlayerFromCharacter(child.Parent)
        if player and player:FindFirstChild 'Backpack' and player.Backpack:FindFirstChild "Gun" then
            player.Backpack.Gun:Remove()
        end
    end
end)
Report Abuse
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
21 Nov 2011 08:02 PM
@Julien,

I can't sit down with that script.
Report Abuse
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
21 Nov 2011 08:04 PM
"Siddown".

"I can't sit down with that script."

Yep, average intelligence of someone in a warclan.

BTW, read the sticky.
http://www.roblox.com/Forum/ShowPost.aspx?PostID=9772680
Report Abuse
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
21 Nov 2011 08:11 PM
XD


And I've read that sticky.
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