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 » Scripting Helpers
Home Search
 

Re: ClickDetector script not Working....

Previous Thread :: Next Thread 
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:19 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:20 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:23 PM
[ Content Deleted ]
Report Abuse
bulletman20 is not online. bulletman20
Joined: 27 Oct 2009
Total Posts: 40
03 May 2014 12:27 PM
Remove "local" before the plr = game.Players.LocalPlayer
Also, make sure it is a local script.
Report Abuse
Queliux is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 12:28 PM
Does anything happen?
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:28 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:29 PM
[ Content Deleted ]
Report Abuse
Queliux is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 12:30 PM
Does anything happen at all? Also leave it without local before plr anyway.
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:31 PM
[ Content Deleted ]
Report Abuse
Jazzyforcefield is not online. Jazzyforcefield
Joined: 12 Jan 2010
Total Posts: 18838
03 May 2014 12:34 PM
I would put the cloning part in the function. Don't know if it makes a difference, but I would do that.


~To see or not to see, that is the question
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:35 PM
[ Content Deleted ]
Report Abuse
bulletman20 is not online. bulletman20
Joined: 27 Oct 2009
Total Posts: 40
03 May 2014 12:36 PM
Meh. Erm. The only thing I can think of.. maybe the backpack isn't ready, so you have to use the WaitForChild() method? Hm.. That would look something like this.


pcall(function()
plr:WaitForChild('Backpack')
h.Parent = plr.Backpack
game.StarterGui.CheckPoints.Frame.Choose.Visible = false
game.StarterGui.CheckPoints.Frame.GoTo.Visible = true
end
)

script.Parent.ClickDetector.MouseClick:connect(onClick)

Not completely sure if that would fix it, but eh.
Report Abuse
bulletman20 is not online. bulletman20
Joined: 27 Oct 2009
Total Posts: 40
03 May 2014 12:37 PM
Using what I said above, you should put the cloning stuff inside, it could actually fix the error.
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:40 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:44 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:46 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:50 PM
[ Content Deleted ]
Report Abuse
standingthunder is not online. standingthunder
Joined: 01 Jun 2011
Total Posts: 4273
03 May 2014 12:51 PM
[ Content Deleted ]
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 12:58 PM
[ Content Deleted ]
Report Abuse
Queliux is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 01:01 PM
--Put this in a LocalScript in the brick that needs to be clicked.
--Put a ClickDetector in the brick that needs to be clicked.

wep = "G18"
Wep = game.Lighting:FindFirstChild(wep)

function onClick(click)
for i,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
if v.Name == wep then
break end end
print("Already has the weapon")
Wep:Clone().Parent = game.Players.LocalPlayer.Backpack
wait(0.1)
game.StarterGui.CheckPoints.Frame.Choose.Visible = false
game.StarterGui.CheckPoints.Frame.GoTo.Visible = true
end

script.Parent.ClickDetector.MouseClick:connect(onClick)
Report Abuse
Aethium is not online. Aethium
Joined: 29 Mar 2014
Total Posts: 574
03 May 2014 01:03 PM
try putting a wait() at the top

- Add 1.5k | Deplexity | its a lego men game stop worrying
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 01:05 PM
[ Content Deleted ]
Report Abuse
Queliux is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 01:07 PM
I'm pretty sure
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
03 May 2014 01:10 PM
[ Content Deleted ]
Report Abuse
Queliux is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 01:11 PM
I've tested something similar before, and that worked and there isn't much f a change in this script, it should work fine.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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