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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Starterpack script troubles

Previous Thread :: Next Thread 
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
01 Mar 2012 05:14 PM
I am making a build/fight game. I need a script that, after a certain amount of time, removes the building tools in your StarterPack, and puts in fighting tools. Any suggestions on how I could do that?
Report Abuse
ServerHax is not online. ServerHax
Joined: 29 Feb 2012
Total Posts: 16
01 Mar 2012 05:35 PM
I have an idea... But this is what I would put in the tool in a different script.

while true do
wait(0.5)
if game.Workspace.Build.Value == false then
script.Parent:remove()
elseif game.Workspace.Build.Value == true then
print("Not time yet")
end
end
-- not sure if this is needed... end
Report Abuse
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
01 Mar 2012 08:53 PM
Nope, didn't work. Even tested your idea in 4 different other ways. Perhaps putting the tools into Lighting, then making the script take the current tools away, then put the new tools in? Also it would help if the script then ended with a wait. Like,

Complicated script that I am yet to come up with
that will change the tools:
wait(400)
Repeat command to make the script continue forever

that way as the rounds end, the script continues.

Ideas? If it's a bad idea could someone help me out a little more?
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
01 Mar 2012 08:56 PM
Actually jonman, your on the right path. You have to make it wait a certain amount of time, then remove the tools in backpack, and take new ones out of lighting. I might be able to find a script like this for you one sec.

+-Fishy
Report Abuse
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
01 Mar 2012 08:58 PM
Thanks! If you find me one, I will credit you for the help :D

~~jonman11
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
01 Mar 2012 08:59 PM
Ok. There was actually a post about the same thing earlier...but I can't seem to find it. I'll keep looking though.

+-Fishy
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
01 Mar 2012 09:04 PM
This is one fairly close to what your looking for. This script that says "when a brick is touched, remove the tools in backpack, and insert the ones from lighting". You will have to edit it to a wait() instead of onTouch. I'll try to help if you want. Here it is:

 script.Parent.Touched:connect(function(hit)
ply = game.Players:GetPlayerFromCharacter(hit.Parent)
if ply then
if hit.Parent:FindFirstChild("ToolGiven") == nil then
ply.Backpack:ClearAllChildren()
tag = Instance.new("StringValue",hit.Parent)
tag.Name = "ToolGiven"
for i,v in pairs(game.Lighting.Tools:GetChildren()) do
tool = v:clone()
tool.Parent = ply.Backpack
end
end
end
end)


+-Fishy
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
01 Mar 2012 09:12 PM
Something along the lines of this. Not saying that this is right, but closer.

game.Players.CharecterAdded:GetPlayerFromCharacter(plyr()
plyr = game.Players:GetPlayerFromCharacter(CharacterAdded()
if plyr then
if CharacterAdded:FindFirstChild("ToolGiven") == nil then
plyr.Backpack:ClearAllChildren()
tag = Instance.new("StringValue",CharacterAdded)
tag.Name = "ToolGiven"
for i,v in pairs(game.Lighting.Tools:GetChildren()) do
tool = v:clone()
tool.Parent = plyr.Backpack
end
end
end
end)

+-Fishy
Report Abuse
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
02 Mar 2012 05:10 AM
Thanks! I will try it and tweak it to try and get it to work.

~~jonman11
Report Abuse
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
02 Mar 2012 12:57 PM
I am unable to tweak it. I have tried 13 different attempts now. Anyone got any other suggestions, or how to fix it? I need help :O
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
02 Mar 2012 03:06 PM
Well, instead of going off my wrong second version, go off the onTouch version. I know that one works because the thread I got this from, the person that wanted it said it worked...sooo...I guess just go off of that.

+-Fishy
Report Abuse
jonman11 is not online. jonman11
Joined: 30 Jan 2010
Total Posts: 3386
02 Mar 2012 07:13 PM
Ok, thanks. I might change it to wait, perhaps.
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