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: Works in studio, doesn't work in game

Previous Thread :: Next Thread 
leo1457 is not online. leo1457
Joined: 01 May 2014
Total Posts: 6921
07 Oct 2016 12:11 PM
LocalScript that works in studio:

player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
player.TeamColor = BrickColor.new("Bright red")
player.Character:MoveTo(workspace.JapanSpawn.Position)
player.PlayerGui.TeamChange.Frame.Visible = false
player.PlayerGui.WelcomeScreen.Frame.Visible = true
end)

What do I do?


Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
07 Oct 2016 12:13 PM
Is the local script a decedent of workspace or a gui?
Report Abuse
Cytheur is not online. Cytheur
Joined: 12 Aug 2014
Total Posts: 7328
07 Oct 2016 12:17 PM
It's obviously from a GUI since he's using the MouseButton1Click


If it's Filtering Enabled it won't work.



R$552,726
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
07 Oct 2016 12:18 PM
^yup, client won't be able to do these two lines:

player.TeamColor = BrickColor.new("Bright red")
player.Character:MoveTo(workspace.JapanSpawn.Position)
Report Abuse
Cytheur is not online. Cytheur
Joined: 12 Aug 2014
Total Posts: 7328
07 Oct 2016 12:20 PM
In some of my local scripts, I like to add this.

repeat wait() until game.Players.LocalPlayer

It might be a placebo, but I swear that has fixed some strange bugs before.


R$552,726
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
07 Oct 2016 12:21 PM
Most likely placebo.

If the .LocalPlayer property did not exist, you would not be in the game.

If you're not in the game, you don't have the script.
Report Abuse
leo1457 is not online. leo1457
Joined: 01 May 2014
Total Posts: 6921
07 Oct 2016 12:25 PM
ok


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