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: I need help with a script idea...

Previous Thread :: Next Thread 
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 02:55 PM
I'd like to make a script that when the player with the right team would clic the Surface GUI button it would open up a menu on that surface gui. for some reason LocalScript dosen't work in the Public Servers only in Test

so

if game.Players.LocalPlayer.Team == game.Teams["Team"] then

dosen't work

nor does

if game.PLayers.LocalPlayer.TeamColor == BrickColor.new("TeamColor") then

any help?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
27 Dec 2016 02:57 PM
adornee


Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
27 Dec 2016 02:59 PM
Even I have no idea what you mean by adornee.

All I can say is add some prints to see how far your script is getting. This will allow you to determine the problem lines.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 03:02 PM
what does adornee mean?
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 03:04 PM
I just googled adornee Roblox I know what it means...

It's adorne'd to an invisible Part called "DJ" in the workspace.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 03:30 PM
~Bump~ help?
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
27 Dec 2016 03:32 PM
So the SurfaceGui is in the PlayerGui and you're using a LocalScript?
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
27 Dec 2016 03:33 PM
Ok I just noticed I didn't have to ask this question...
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 03:34 PM
lol any help?
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
27 Dec 2016 03:44 PM
"All I can say is add some prints to see how far your script is getting. This will allow you to determine the problem lines." [2]
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 03:47 PM
but I can't see print in public server... and in test servers everything's fine
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
27 Dec 2016 03:59 PM
I think if you press on F5 or F9 you get an output while in public servers. If you're the owner, you can access both server and local output, while others only access the local one.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 04:01 PM
actually I just checked it out , there's nothing that shows up but the "localPlayer" just dosen't work how do I manage to bypass that to restrict the button to a team only?
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
27 Dec 2016 04:05 PM
Can you show us the whole script.
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
27 Dec 2016 04:08 PM
if game.Players.LocalPlayer.Team == game.Teams[Team] then


You put Team in quotations, meaning its a string, which it isn't.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 04:12 PM
local Music = script.Parent.Sound
local Play = script.Parent.Parent.Parent.Playing

function onClick()
if game.Players.LocalPlayer.Team == game.Teams["Disc Jokey"] then
end
if Music.Playing == true then
Music.Playing = false
Play.Text = ("Nothing's Playing.")
elseif Music.Playing == false and Play.Text == ("Nothing's Playing.") then
Play.Text = ("Currently Playing.")
Music.TimePosition = 0
Music.Playing = true
wait(186)
Play.Text = ("Nothing's Playing.")
end
end

script.Parent.MouseButton1Click:connect(onClick)

This is my whole script.
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
27 Dec 2016 05:16 PM
regular script or local script??
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 07:14 PM
Local
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
27 Dec 2016 07:19 PM
try this

local Player = game.Players.LocalPlayer
local Gui = script.Parent
local Music = Gui:WaitForChild('Sound')
local Play = Gui.Parent.Parent.Playing

Gui.MouseButton1Click:connect(function()
if Player.Team == game.Teams['Disc Jokey'] then
if Music.Playing then
Music.Playing = false
Play.Text = 'Nothing is Playing'
elseif not Music.Playing and Play.Text == 'Nothing is Playing' then
Play.Text = 'Currently Playing'
Music.TimePosition = 0
Music.Playing = true
wait(186)
Play.Text = 'Nothing is Playing'
end
end
end)


Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 08:15 PM
This is the error it gave me attempt to index upvalue 'Player' (a nil value)
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 08:47 PM
~bump~
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
27 Dec 2016 09:12 PM
~Bump again~ @TimeTicks Help plz?
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
27 Dec 2016 09:17 PM
Put it in a localscript.


Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
28 Dec 2016 10:56 AM
~bump once more.~
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
28 Dec 2016 02:41 PM
Wait for the Player to load. I think the script loads before the player.

repeat wait() until game.Players.LocalPlayer

Just add this to the beginning of the script.
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