AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 11 Jun 2016 10:45 PM |
So I have a script that checks if ur on a team and if u are then it clones a tool into your backpack only, and for some reason the tool doesnt work if it is cloned into the inventory.
Tool type: script script type: global, not local Tool Position: lighting and gets cloned to backpack when on certain team
tool script: repeat wait() until script.Parent.Parent.Parent.Character.Humanoid local enabled = true
function onButton1Down(mouse) if not enabled then return end enabled = false local cf = mouse.Hit local v = cf.p if (v - script.Parent.Parent.Parent.Character.Head.Position).magnitude > 20 and (v - script.Parent.Parent.Parent.Character.Head.Position).magnitude < 150 then local boulder = script.Parent.Boulder:Clone() boulder.KillScript.Disabled = false boulder.Parent = game.Workspace boulder.Position = v + Vector3.new(0,3,0) -- offset. boulder.creator.Value = script.Parent.Parent.Parent boulder.Velocity = (v - script.Parent.Parent.Parent.Character.Head.Position).unit * 10 -- give it a little push. wait(5) boulder.Parent = nil enabled = true else enabled = true end end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected)
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2016 10:59 PM |
Try at the end
mouse.MouseButton1Click:connect(function() onButton1Down(mouse) end)
Unless you want the tool to work when holding. |
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
| |
|
|
| 11 Jun 2016 11:13 PM |
| But what is the error in the output? |
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
| |
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 11 Jun 2016 11:14 PM |
also it works in studio but not in game
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2016 11:24 PM |
| Post the script that has the team tool clone thing. |
|
|
| Report Abuse |
|
|
Incendias
|
  |
| Joined: 21 Sep 2012 |
| Total Posts: 24 |
|
|
| 11 Jun 2016 11:24 PM |
| Try using a localscript instead, the same thing happened to me a few days ago. Some things if not in a local script work in studio but not in the game server. |
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 11 Jun 2016 11:24 PM |
Its in starter player scripts
repeat wait() until game.Players.LocalPlayer local player = game.Players.LocalPlayer if player.TeamColor == game.Teams.King.TeamColor then game.Lighting.Boulder:Clone().Parent = player.Backpack end
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2016 11:28 PM |
| Oh LocalPlayer! Use LocalScript. |
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 11 Jun 2016 11:29 PM |
I am for that script
not the other 1
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2016 11:45 PM |
| I know xD But it may be related to the other one. |
|
|
| Report Abuse |
|
|