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: Loops in a remote event

Previous Thread :: Next Thread 
fletchered is not online. fletchered
Joined: 22 Sep 2009
Total Posts: 1075
22 Jan 2017 04:54 PM
I'm trying to repeat wait(0.1) until players stats but it wont repeat why help
Report Abuse
Rocketerkid is not online. Rocketerkid
Joined: 10 Oct 2011
Total Posts: 1237
22 Jan 2017 05:02 PM
I'm afraid you're going to have to be more descriptive.

Would you mind showing us the script in question?
Report Abuse
fletchered is not online. fletchered
Joined: 22 Sep 2009
Total Posts: 1075
22 Jan 2017 05:06 PM
local event = Instance.new("RemoteEvent")
event.Name = "animate"
event.Parent = game.Workspace
event.OnServerEvent:connect(function()
repeat wait(0.1) print("waiting") until game.Players.LocalPlayer.IDa.Value == "1"
print("passed")
local Idle1 = game.Workspace.NPC1:WaitForChild("Idle1")
local Idle2 = game.Workspace.NPC1:WaitForChild("Idle2")

local anim1 = game.Workspace.NPC1.Humanoid:LoadAnimation(Idle1)
local anim2 = game.Workspace.NPC1.Humanoid:LoadAnimation(Idle2)

anim1:Play()

end)
Report Abuse
fletchered is not online. fletchered
Joined: 22 Sep 2009
Total Posts: 1075
22 Jan 2017 05:09 PM
the event works without the repeat loop... so idk whats going on
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
22 Jan 2017 05:38 PM
You can't get "game.Players.LocalPlayer" from a server script
You need to use the first argument, that is

YourEvent.OnServerEvent:connect(function(player)
repeat wait() until player.leaderstats.blahblah == "blah"
print("works")
end)


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