|
| 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
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
| |
|
|
| 23 Nov 2011 05:34 PM |
| Its his first post! Lets throw a party! |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Nov 2011 05:42 PM |
| awwww :(, I though x-mas celebration came early. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 23 Nov 2011 06:37 PM |
| DXPower, are you saying it should be like; function onClick(LocalPlayer) or what? |
|
|
| Report Abuse |
|
|