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