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: LoadCharacter() Alternative for Local Scripts?

Previous Thread :: Next Thread 
Pikachu84639 is not online. Pikachu84639
Joined: 21 Nov 2011
Total Posts: 230
27 Dec 2015 10:00 PM
Hello,
I'm trying to make a LocalScript in which part of it requires that the Local Player respawns, just like it would with the LoadCharacter function that can only be used server-side.

I can't set the Health of the Player to 0, because it would play the "oof" sound, which I don't want.

Thanks,
Pikachu84639
• The answer to a math question is the question itself. Proof: 9+10 = 9+10 - Correct ✔
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
27 Dec 2015 10:03 PM
you sure LoadCharacter doesnt work locally? Thought it did...
Report Abuse
Pikachu84639 is not online. Pikachu84639
Joined: 21 Nov 2011
Total Posts: 230
27 Dec 2015 10:05 PM
It doesn't, it gives me an error saying it can only be ran server-side.

• The answer to a math question is the question itself. Proof: 9+10 = 9+10 - Correct ✔
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
27 Dec 2015 10:07 PM
Put a remote event inside of ReplicatedStorage
Put a server script inside of ServerScriptService

-- in your local script

local event = game:GetService("ReplicatedStorage"):WaitForChild("YourRemoteEvent")
-- when you want to load the character..
event:FireServer()


-- in your server script
local event = game:GetService("ReplicatedStorage"):WaitForChild("YourRemoteEvent")

event.OnServerEvent:connect(function(player)
player:LoadCharacter()
end)
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
27 Dec 2015 10:07 PM
Remove neck?
Humanoid:ChangeState("Dead")?
Humanoid:TakeDamage(-1000)?

No matter what, oof would play I believe. If it's connected to the Died event of humanoid, then sadly this is true.

Maybe you can set the volume to 0 on this sound temporarily.
Report Abuse
Pikachu84639 is not online. Pikachu84639
Joined: 21 Nov 2011
Total Posts: 230
27 Dec 2015 10:19 PM
@instawin
That worked, thanks!

Pikachu84639
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