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: Will this work?

Previous Thread :: Next Thread 
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:29 AM
local ToolName = "TOOLNAMEHERE"
local Character = script.Parent.Parent.Character
local Player = game.Player.LocalPlayer
if Character.ToolName then
Player.Backpack.Parent = Player.PlayerGui

end


local Tool = Character.ToolName
local Removed = Tool:Removed()
if Character.ToolName == Removed then
Player.PlayerGui.Backpack.Parent = Player
end
Report Abuse
janthran2 is not online. janthran2
Joined: 12 Jun 2009
Total Posts: 84
31 Aug 2013 12:32 AM
You can't do
Item.Variable
So no, it won't work.
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:34 AM
Do you know how to make it work? .-.
Report Abuse
janthran2 is not online. janthran2
Joined: 12 Jun 2009
Total Posts: 84
31 Aug 2013 12:38 AM
Character:FindFirstChild(ToolName)
I think
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:40 AM
What line would that be in the script?
Report Abuse
janthran2 is not online. janthran2
Joined: 12 Jun 2009
Total Posts: 84
31 Aug 2013 12:42 AM
local ToolName = "TOOLNAMEHERE"
local Character = script.Parent.Parent.Character
local Player = game.Player.LocalPlayer
if Character.ToolName then
Player.Backpack.Parent = Player.PlayerGui

Change to

local ToolName = "TOOLNAMEHERE"
local Character = script.Parent.Parent.Character
local Player = game.Player.LocalPlayer
if Character:FindFirstChild(ToolName) then--Right over here
Player.Backpack.Parent = Player.PlayerGui
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:46 AM
Will this work too?:


local Tool = Character.ToolName
local Removed = Tool:Removed()
if Character.ToolName == Removed then
Player.PlayerGui.Backpack.Parent = Player
end


To see the tools again?
Report Abuse
janthran2 is not online. janthran2
Joined: 12 Jun 2009
Total Posts: 84
31 Aug 2013 12:47 AM
Replace
Character.ToolName
with
Character:FindFirstChild(ToolName)
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:49 AM
So:


local Removed = Tool:Removed()
if Character.ToolName == Removed then


Will work?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
31 Aug 2013 12:50 AM
What are you trying to do exactly?
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 12:55 AM
When you use a tool, your player's Backpack's parent changes, so you have no tool. When you put the tool down, you get your tools back.

This is the script:

print("Remove/Get tools script loaded... Creator: pikaard and a few other people's help.")
local Config = script.Configuration
local ToolName = Config.ToolName.Value
local Character = script.Parent.Parent.Character
local Player = game.Player.LocalPlayer

if Character:FindFirstChild(ToolName) then
Player.Backpack.Parent = Player.PlayerGui
end



local Tool = Character:FindFirstChild(ToolName)
local Removed = Tool:Removed()
if Character.ToolName == Removed then
Player.PlayerGui.Backpack.Parent = Player
end
Report Abuse
pikaardbackupalt is not online. pikaardbackupalt
Joined: 07 Apr 2013
Total Posts: 53
31 Aug 2013 01:11 AM
Well? Will it work?
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