RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:16 PM |
So I made this script for a gui shop, but it won't handle weapons with a space like for example: Golden Katana won't work but GoldenKatana will. How do I make it so that it can work with a space in the name of the tool?
Cash = script.Parent.Parent.Parent.Parent.Parent.IntValue.Gold
function onClick() if Cash.Value >= 1 then Cash.Value = Cash.Value - 1 local Noobz = game.Lighting.Toolname:clone() Noobz.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear local Noobz = game.Lighting.Toolname:clone() Noobz.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack Noobz.Handle.Anchored = false end end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
Subete
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 917 |
|
|
| 31 Aug 2014 10:17 PM |
use [' ']
ie ['Golden Katana'] |
|
|
| Report Abuse |
|
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:20 PM |
| It didn't work, error lines are showing up. |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2014 10:22 PM |
| local Noobz = game.Lighting['Tool name']:clone() |
|
|
| Report Abuse |
|
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:24 PM |
| Line 6 shows error when you add [''] |
|
|
| Report Abuse |
|
|
| |
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:29 PM |
| I mean line 6 has the red error line when you add the [' '] |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2014 10:30 PM |
| scroll over the line with error and tell me what it says |
|
|
| Report Abuse |
|
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:34 PM |
Line 6: local Noobz = game.Lighting.['Golden Katana']:clone()
20:31:57.291 - Script 'Players.Player1.PlayerGui.ShopGui.Shop.3.BuyScript', Line 6 20:31:57.293 - Stack End |
|
|
| Report Abuse |
|
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
|
| 31 Aug 2014 10:36 PM |
local Noobz = game.Lighting['Golden Katana']:clone()
not
local Noobz = game.Lighting.['Golden Katana']:clone() |
|
|
| Report Abuse |
|
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:38 PM |
| @Above, looks the same to me. |
|
|
| Report Abuse |
|
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
| |
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
| |
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
| |
|
RinYamato
|
  |
| Joined: 11 Aug 2013 |
| Total Posts: 48 |
|
|
| 31 Aug 2014 10:41 PM |
| Oh wait Bob can you hint me on how to make it so that the player cannot purchase it twice? |
|
|
| Report Abuse |
|
|