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 » Scripting Helpers
Home Search
 

Re: Trouble with LocalPlayer

Previous Thread :: Next Thread 
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
11 Jan 2014 02:51 PM
Good afternoon,

I was making a gui that loads the player's character 2.5 seconds after the player clicks it. The .MouseButton1Down event is firing, but the player's character is not loading and I do not know why. I checked, and made sure that the script is in a LocalScript and that the CharacterAutoLoads property under the Players service is set to true.


local gui = script.Parent
local screenGui = script.Parent.Parent
local Player = game.Players.LocalPlayer
local sound = Player.PlayerGui:findFirstChild("HoverIntroGui")
local db = true

gui.MouseEnter:connect(function()

gui.TextColor3 = Color3.new(255/255, 0/255, 0/255)
if sound then
sound:Play()
end

gui.MouseButton1Down:connect(function()

if db then
db = false
print("Clicked")

repeat
wait(.04)
screenGui.Background.BackgroundTransparency = screenGui.Background.BackgroundTransparency - .01
print(screenGui.Background.BackgroundTransparency)
until screenGui.Background.BackgroundTransparency <= 0

wait(2.5)
Player:LoadCharacter()
end

end)

gui.MouseLeave:connect(function()

gui.TextColor3 = Color3.new(0/255, 0/255, 0/255)

end)

end)







Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
11 Jan 2014 02:59 PM
The "LoadCharacter" method can only be used server-side.
Report Abuse
jmasterj10 is not online. jmasterj10
Joined: 19 Sep 2010
Total Posts: 735
11 Jan 2014 03:02 PM
^ What he said
Report Abuse
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
11 Jan 2014 03:22 PM
Is there another way to call it locally?
Report Abuse
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
11 Jan 2014 03:42 PM
Bump.
Report Abuse
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
11 Jan 2014 04:12 PM
Should I just keep the scripts to the gui server sided?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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