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: playerAdded

Previous Thread :: Next Thread 
blocker79 is not online. blocker79
Joined: 31 Jan 2010
Total Posts: 29
10 May 2014 11:41 PM
Is there any way to trigger this for testing?
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
10 May 2014 11:43 PM
What is that supposed to mean? You could create a function that you can call if you'd like then have the PlayerAdded Event call the function therefor allowing you to call the function yourself if that is what you mean.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
10 May 2014 11:45 PM
Use loadstring for testing
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
10 May 2014 11:45 PM
"Use loadstring for testing"

What are you talking about?
Report Abuse
blocker79 is not online. blocker79
Joined: 31 Jan 2010
Total Posts: 29
10 May 2014 11:46 PM
Sorry I should have been MUCH more clear. I mean't triggering and passing an instance of a player a "test" player of sorts?
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
10 May 2014 11:46 PM
Does loadstring still work? I don't think it works in scripts, only in command bar.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
10 May 2014 11:46 PM
What are you talking about?[x2]
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
10 May 2014 11:48 PM
loadstring still works.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
10 May 2014 11:49 PM
So you mean

function playerAdded(Player)
--code here
end
game.Players.PlayerAdded:connect(playerAdded)

playerAdded(PlayerInstance)
Report Abuse
blocker79 is not online. blocker79
Joined: 31 Jan 2010
Total Posts: 29
10 May 2014 11:52 PM
function newPlayer(player)
print("player " .. player.Name .. " entered the game")
if(DS ~= nil) then
if(game:GetService("DataStoreService"):GetDataStore(DS, tostring("user_" .. player.userId)) == nil) then
addtoCurrent(player)
--else
end
end
end

game.Players.PlayerAdded:connect(function(player)
newPlayer(player)
end)

this is a tiny snipit of code but the start of it and I need variables passed on by this to test the rest. I want to make a "test" player to pass through the code.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
10 May 2014 11:53 PM
function newPlayer(player)
print("player " .. player.Name .. " entered the game")
if(DS ~= nil) then
if(game:GetService("DataStoreService"):GetDataStore(DS, tostring("user_" .. player.userId)) == nil) then
addtoCurrent(player)
--else
end
end
end

Well you shouldn't create a new function to call a function it is unnecessary

game.Players.PlayerAdded:connect(player)
newPlayer(player)
end)
Report Abuse
blocker79 is not online. blocker79
Joined: 31 Jan 2010
Total Posts: 29
10 May 2014 11:54 PM
I know I still haven't cleaned up the code I've just been working though ideas.
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