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
 

Loadstring() problem

Previous Thread :: Next Thread 
UndeleteTool is not online. UndeleteTool
Joined: 15 Mar 2012
Total Posts: 1851
16 Mar 2013 06:23 AM
Can anyone telling me what I'm doing wrong here? I want a player who joins with their data value as "OMEGA" to turn the Base reflectance to 1. These are all in the same script btw.

game.Players.PlayerRemoving:connect(function(player)
if player.DataReady then
player:SaveString("Data", "OMEGA")
end
end)

game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()
player:LoadString("Data")
if string.Value == "OMEGA" then
game.Workspace.Base.Reflectance = 1
end
end)
Report Abuse
einsteinK is not online. einsteinK
Joined: 22 May 2011
Total Posts: 1015
16 Mar 2013 06:52 AM

game.Players.PlayerRemoving:connect(function(player)
if player.DataReady then
player:SaveString("Data", "OMEGA")
end
end)

game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()
if player:LoadString("Data") == "OMEGA" then -- Here was your mistake
game.Workspace.Base.Reflectance = 1
end
end)
Report Abuse
UndeleteTool is not online. UndeleteTool
Joined: 15 Mar 2012
Total Posts: 1851
16 Mar 2013 07:12 AM
Thanks it works
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