generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: [Easy] anyone know this?

Previous Thread :: Next Thread 
AxeHeads is online. 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
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
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 is online. AxeHeads
Joined: 07 Jan 2016
Total Posts: 840
11 Jun 2016 11:11 PM
that doesnt work o.o



Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
11 Jun 2016 11:13 PM
But what is the error in the output?
Report Abuse
AxeHeads is online. AxeHeads
Joined: 07 Jan 2016
Total Posts: 840
11 Jun 2016 11:13 PM
Thats the thing, nothing.


Report Abuse
AxeHeads is online. 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
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
11 Jun 2016 11:24 PM
Post the script that has the team tool clone thing.
Report Abuse
Incendias is not online. 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 is online. 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
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
11 Jun 2016 11:28 PM
Oh LocalPlayer! Use LocalScript.
Report Abuse
AxeHeads is online. 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
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
11 Jun 2016 11:45 PM
I know xD But it may be related to the other one.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image