|
| 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
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 11 Jan 2014 02:59 PM |
| The "LoadCharacter" method can only be used server-side. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jan 2014 03:22 PM |
| Is there another way to call it locally? |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jan 2014 04:12 PM |
| Should I just keep the scripts to the gui server sided? |
|
|
| Report Abuse |
|
|