ols9436
|
  |
| Joined: 01 Oct 2011 |
| Total Posts: 487 |
|
|
| 24 Jul 2013 07:49 AM |
| I have used Skyline's shop button and the script makes it so that when you buy something it just stays until you reset, how do I make it so that you have it then and after you reset .Starterpack is a way but you have to reset to get the tools. Help appreciated. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 07:50 AM |
| you can put the tools in the player's startergear |
|
|
| Report Abuse |
|
|
ols9436
|
  |
| Joined: 01 Oct 2011 |
| Total Posts: 487 |
|
|
| 24 Jul 2013 07:54 AM |
| I know that, but you have to reset before you get the tools if you use that. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 07:57 AM |
| Just put it in the backpack and the starter gear? |
|
|
| Report Abuse |
|
|
ols9436
|
  |
| Joined: 01 Oct 2011 |
| Total Posts: 487 |
|
|
| 24 Jul 2013 08:02 AM |
| No because it's a shop, and you have to buy it... And if you mean in the script, i've tried |
|
|
| Report Abuse |
|
|
DrWaffler
|
  |
| Joined: 16 Sep 2011 |
| Total Posts: 4248 |
|
|
| 24 Jul 2013 08:04 AM |
When they buy the tool, clone it and put it into their backpack.
So when you click the button that buys it, if they can buy it, do this
MyTool = game.Lighting.MyTool:clone() MyTool.Parent = player.Backpack
--more script
I am reborn as an ocelot. You disapprove. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 08:05 AM |
| When I said startergear I meant the starter thing object that's in the player object. |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 24 Jul 2013 08:21 AM |
You need to use values to remember what items he has bought already.
You place all the tools that can be bought in game.Lighting. Then you make the button so he takes a copy of the tool in lighting and gives it to the player but also make the button give you an ObjectValue and put the value to the gun he just bought. (maybe first make a value or model called 'Tools' and put the objectvalues in that value or model)
And then you add this script to the StarterGui: (I'm not sure it is working, haven't tested it)
tools = script.Parent.Parent:FindFirstChild("Tools") if tools == nil then local tools = Instance.new("StringValue") tools.Parent = script.Parent.Parent end if tools then stuff = tools:GetChildren() for i=1 , #stuff do item = stuff[i].Value:Clone() item.Parent = script.Parent.Parent.Character end end |
|
|
| Report Abuse |
|
|
Puzzly
|
  |
| Joined: 05 Mar 2013 |
| Total Posts: 7 |
|
|
| 24 Jul 2013 09:05 AM |
StarterGear is inside the player. You can access it in scripts.
Example: tools:Clone().Parent = player.Backpack tools:Clone().Parent = player.StarterGear |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 24 Jul 2013 09:06 AM |
I tested it I had to make a little adjustment. My button ain't yet a button that checks the amount of cash and the tycoon owner, this button can be used by anyone. I grouped this script with a part called 'Button'.
tool = game.Lighting.LinkedPaintballGun function onTouched(hit) local item = tool:Clone() item.Parent = hit.Parent script.Parent:remove() local value = Instance.new("ObjectValue") value.Value = tool value.Parent = game.Players:FindFirstChild(hit.Parent.Name).Tools end script.Parent.Button.Touched:connect(onTouched)
Then I placed a LinkedPaintballGun in Lighting.
I placed this script in the StarterGui:
tools = script.Parent.Parent:FindFirstChild("Tools") if tools == nil then local tools = Instance.new("StringValue") tools.Name = "Tools" tools.Parent = script.Parent.Parent end if tools then stuff = tools:GetChildren() for i=1 , #stuff do item = stuff[i].Value:Clone() item.Parent = script.Parent.Parent.Backpack end end
Now I get the weapon when I press the button (then the button dissapears). When I die or reset character I get the weapon back when I spawn. |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 24 Jul 2013 09:07 AM |
| @puzzly Indeed you are right but I prefer first making it a variable and then adjust the properties in the next lines. |
|
|
| Report Abuse |
|
|