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: Help with ClickDetectors

Previous Thread :: Next Thread 
ConcealedShadow is not online. ConcealedShadow
Joined: 01 Jul 2011
Total Posts: 6
23 Nov 2011 05:28 PM
I made this script and put it inside the click detector. It works in Studio mode, but not in online mode. Can anyone help out?

function onClicked()
local p = game.Players.LocalPlayer
if (p.Backpack.Menu.Sticks.Value == false) then
p.Backpack.Menu.Sticks.Value = true
i = game.Lighting.Info:clone()
i.Parent = p.PlayerGui
i.Frame.TextLabel.Text = "These sticks might be useful. I better take some!"
i.Frame.Visible = true
else
i = game.Lighting.Info:clone()
i.Parent = p.PlayerGui
i.Frame.TextLabel.Text = "I already have enough sticks! Lets try finding something else."
i.Frame.Visible = true
end
end


script.Parent.MouseClick:connect(onClicked)

I'm guessing it's a problem with the second line.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
23 Nov 2011 05:31 PM
Is this in a LocalScript?
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
23 Nov 2011 05:34 PM
Its his first post! Lets throw a party!
Report Abuse
ConcealedShadow is not online. ConcealedShadow
Joined: 01 Jul 2011
Total Posts: 6
23 Nov 2011 05:40 PM
No, this is in a normal script. I tried a LocalScript in Studio mode, but it didn't work. Oh, and no, this is not my first post.. this is an alt account :/
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
23 Nov 2011 05:42 PM
awwww :(, I though x-mas celebration came early.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
23 Nov 2011 05:44 PM
Eh, whats the output?
Report Abuse
ConcealedShadow is not online. ConcealedShadow
Joined: 01 Jul 2011
Total Posts: 6
23 Nov 2011 05:53 PM
I get no output. It works in Studio Mode, I am just trying to find a way to get it working in online mode, but I can't find any other way to GetPlayerFromCharacter using ClickDetectors.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
23 Nov 2011 05:54 PM
hmmm.. See I have the same problem with my GUI local script, though the thing is it works in studio but not online like yours. I have no clue how to fix it and ROBLOX would rather fancy there site than worry about Lua.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
23 Nov 2011 06:06 PM
You have to use a localscript. They don't work in Studio mode, BTW.

You have to test in Online mode.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
23 Nov 2011 06:11 PM
Yeh, they do work in studio mode, I've dont it plenty of time and they are in local scripts.
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
23 Nov 2011 06:30 PM
1. Needs to be in local script.
2. Add the argument "localPlayer" in the parantheses by function onClick(ADD THEM HERE)
Report Abuse
ConcealedShadow is not online. ConcealedShadow
Joined: 01 Jul 2011
Total Posts: 6
23 Nov 2011 06:37 PM
DXPower, are you saying it should be like; function onClick(LocalPlayer) or what?
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