RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 11:15 AM |
So I created a surfacegui and I'm trying to make the owner of that part be the only person who's able to click it, I tried something stupid:
script.Parent.MouseButton1Click:connect(function(plyr) if game.Workspace.Tycoon1.Owner.Name == plyr.Name then bla bla bla
Since plyr is a nil value in here.
Thanks if you can help.
--RoKjell-- |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 11:19 AM |
add
game.Players.LocalPlayer.PlayerAdded:connect(function(ply) if game.Workspace.Tycoon1.Owner.Name == ply.Name then script.Parent.MouseButton1Click:connect(function() --code end end) end) |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 11:19 AM |
I knew the first response would be a LocalScript :p well let's change it to a LocalScript then
Thanks anyways
--RoKjell-- |
|
|
| Report Abuse |
|
|
| |
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 11:39 AM |
It doesn't give any error anymore but clicking it does nothing.
I also have this problem:
if game.Players:FindFirstChild(game.Workspace.Tycoon1.Owner.Value).TycoonBuys >= 2 and game.Players:FindFirstChild(game.Workspace.Tycoon1.Owner.Value).TycoonBuys <= 6 then
This gives this error: attempt to compare number with userdata
--RoKjell-- |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 06 Sep 2015 11:44 AM |
| TycoonBuys.Value not TycoonBuys |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 11:56 AM |
| game:Getmouse or something like that 2 b able 2 use the mouse |
|
|
| Report Abuse |
|
|
Vortilis
|
  |
| Joined: 06 Jul 2014 |
| Total Posts: 14163 |
|
|
| 06 Sep 2015 11:56 AM |
script.Parent.MouseButton1Click:connect(function(plrClicked) if game.Players.LocalPlayer.userId == game.CreatorId then aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa end end)
http://www.roblox.com/DROP-IT-item?id=145934228 http://www.roblox.com/Toms-Bait-Beans-item?id=292084570 |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 12:02 PM |
Lol thanks locard, it was a stupid mistake XD That's why they say scripters need to be in a group, because other people always see mistakes but the person himself doesn't.
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 12:03 PM |
vortilis, it isn't only meant for me lol
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 12:10 PM |
I don't have to use GetMouse, that's to check when the player himself clicks. So not when he clicks that gui
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 12:28 PM |
I get it, it says: if game.Workspace.Tycoon1.Owner.Name == ply.Name then
But it's an value, he didn't see it right probably and he should know that the name of "Owner" is "Owner" :p
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 12:30 PM |
But it still doesn't work D':
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
Vortilis
|
  |
| Joined: 06 Jul 2014 |
| Total Posts: 14163 |
|
|
| 06 Sep 2015 03:32 PM |
maybe we can help if you gave the output.
www.roblox.com/-item?id=292084570 www.roblox.com/-item?id=145934228 |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 03:55 PM |
There were no errors but I fixed it
--RoKjell-- |
|
|
| Report Abuse |
|
|