|
| 11 Feb 2016 10:48 PM |
local a = tool:clone() a.Parent = game.Workspace a.Position = CFrame.new(player.Character.Torso.Position)
(tool is already set)
tool = game.Lighting.Wood --the part i use player = script.Parent.Parent.Parent.Parent.Parent
Doesn't seem to be going to the player. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Feb 2016 10:51 PM |
player = script.Parent.Parent.Parent.Parent.Parent Hits = player.leaderstats.Wood price = 1 tool = game.Lighting.Wood -- paart
function buy() if Hits.Value >= price then Hits.Value = Hits.Value - price local a = tool:clone() a.Parent = game.Workspace a.Position = CFrame.new(player.Character.Torso.Position.CFrame) end end script.Parent.MouseButton1Down:connect(buy)
@ranvlr2o50
Full script |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 10:51 PM |
You've defined 'player' after setting the a's Position; so 'player' will be nil on this line:
"a.Position = CFrame.new(player.Character.Torso.Position)"
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 10:52 PM |
| ^u again. Let me teach people thrust do. Not ur fake lua |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 10:54 PM |
| Let's not start an argument and be serious. Please. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 10:58 PM |
Ignore my previous one as it was a reply to your first anyways:
Use a local script and define 'player' has the local player
local player = game.Players.LocalPlayer as it saves the time of checking if you have the correct amount of 'parents' in the method you are using.
Unless you don't have the right amount of money I don't see anything wrong with your script.
local player = game.Players.LocalPlayer local Hits = player.leaderstats.Wood local price = 1 local tool = game.Lighting.Wood
function buy() if Hits.Value >= price then Hits.Value = Hits.Value - price local a = tool:clone() a.Parent = game.Workspace a.Position = CFrame.new(player.Character.Torso.Position.CFrame) end end script.Parent.MouseButton1Down:connect(buy)
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:00 PM |
Sorry for the bad grammar been playing sport in some really hot weather:
Ignore my previous post*
'player' as the local player*
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:02 PM |
| @Advanced, Tested again. The brick keeps going at this position. -86.7, 101.8, -85.3 |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:03 PM |
| Maybe i could go on and try to Make it instance.new and things like that. than cloning it. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:04 PM |
| Oh snap. i removed something and now it works. Thanks ^^ |
|
|
| Report Abuse |
|
|
XThane
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 2702 |
|
|
| 11 Feb 2016 11:12 PM |
You can't set it's position to a CFrame.
~ Who's awesome, you're awesome ~ |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:14 PM |
Yes u can ;)
part.Position = CFrame.new(position)
|
|
|
| Report Abuse |
|
|
XThane
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 2702 |
|
|
| 11 Feb 2016 11:16 PM |
"bad argument #3 to 'Position' (Vector3 expected, got CFrame)"
~ Who's awesome, you're awesome ~ |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:18 PM |
local player = game.Players.LocalPlayer local Hits = player.leaderstats.Wood local price = 1 local tool = game.Lighting.Wood
function buy() if Hits.Value >= price then Hits.Value = Hits.Value - price local brick = Instance.new("Part") brick.Anchored = true brick.Size = Vector3.new (2,1,2) brick.BrickColor = BrickColor.new ("Dark orange") brick.Material = "Wood" brick.Position = player.Character.Torso.Position-Vector3.new(0,1.3,0) brick.Parent = game.Workspace end end script.Parent.MouseButton1Down:connect(buy)
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2016 11:19 PM |
Oops, got it mixed up with: part.CFrame = CFrame.new(position)
my bad.
|
|
|
| Report Abuse |
|
|