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: SurfaceGui check for player

Previous Thread :: Next Thread 
RoKjell is not online. 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
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
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 is not online. 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
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
06 Sep 2015 11:21 AM
Loloololol
Report Abuse
RoKjell is not online. 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 is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
06 Sep 2015 11:44 AM
TycoonBuys.Value not TycoonBuys
Report Abuse
ElectoStriking is not online. ElectoStriking
Joined: 10 May 2014
Total Posts: 1547
06 Sep 2015 11:56 AM
game:Getmouse or something like that 2 b able 2 use the mouse
Report Abuse
Vortilis is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. RoKjell
Joined: 22 Nov 2012
Total Posts: 1205
06 Sep 2015 12:40 PM
bump


--RoKjell--
Report Abuse
RoKjell is not online. RoKjell
Joined: 22 Nov 2012
Total Posts: 1205
06 Sep 2015 01:09 PM
Please help
Report Abuse
Vortilis is not online. 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 is not online. 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
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