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: can you make this not crash rbx studio

Previous Thread :: Next Thread 
jamer55 is not online. jamer55
Joined: 03 Mar 2010
Total Posts: 32
20 Feb 2015 05:47 AM
local i = 0
for _,v in pairs(workspace:GetChildren()) do
if v.Name == "yay" then
i = i + 1
end
end
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model", player)
leaderstats.Name = "leaderstats"
end)
while true do
wait (1)
local b = Instance.new("IntValue", leaderstats)
b.Name = "Total bricks"
b.Value = i
end


Output: i dont know becuse it crashes
Report Abuse
AhtnamasStudio is not online. AhtnamasStudio
Joined: 15 Jan 2014
Total Posts: 1104
20 Feb 2015 08:09 AM
remove a part of the script see where its crashing
have tones of waits
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Feb 2015 08:15 AM
local i = 0
for _,v in pairs(workspace:GetChildren()) do
if v.Name == "yay" then
i = i + 1
end
end
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model", player)
leaderstats.Name = "leaderstats"
end)
while true do
local b = Instance.new("IntValue", leaderstats)
b.Name = "Total bricks"
b.Value = i
wait(1)
end
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Feb 2015 08:38 AM
You put a space after wait. So, that's the reason Roblox is crashing.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Feb 2015 08:41 AM
Not certainly; Lua's grammar is fairly good at interpreting whitespace
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Feb 2015 08:44 AM
Well, eLunate, his script looks fine, except for the wait (1) part. Henceforth, that should be the reason of his Roblox crashing.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Feb 2015 08:52 AM
Doesn't matter. If it wasn't waiting then it would error anyway.

I blame something else.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Feb 2015 09:43 AM
...
-.-
.-.
Did you even read the bottom... It isn't waiting because of that problem, and causes the crash.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
20 Feb 2015 09:46 AM
The real question would be is the crash from a hang?


Give me 15 Robux I give you print("Give me 15k")
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Feb 2015 09:52 AM
I did read the bottom, and it would error if it wasn't waiting because other wise Lua would be interpreting two plain value states - The function, and the number. Together they are an invalid syntax because Lua receives an incomplete statement.
Report Abuse
jamer55 is not online. jamer55
Joined: 03 Mar 2010
Total Posts: 32
20 Feb 2015 10:17 AM
i tried doing that script but it randomly crashed.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Feb 2015 10:20 AM
Told you.

Stop using free models ^^
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
20 Feb 2015 10:33 AM
First off, since you're making leaderstats local; it can only be read within the scope First off, you should be getting an error because you made leaderstat local. Since you made it only readable in the scope of the PlayerAdded function.
You should probably seeing some sort of error on
'local b = Instance.new("IntValue", leaderstats)'
It probably says something such as "Undeclared/Unknown Variable leaderstats"


Try this:


steve = coroutine.create(function()
local b = Instance.new("IntValue",leaderstats)
b.Name = "Total Bricks"
b.Value = countyay()
end)

function countyay(loc)
local counter = 0
loc = loc or workspace
for _,v in pairs(loc) do
if v.Name:lower() == "yay" then
counter = counter + 1
end
end
return counter
end

game.Players.PlayerAdded:connect(function(p)
leaderstats = Instance.new("Folder",p)
p.Name = "leaderstats"
coroutine.resume(steve)
end)


However, you can save some time and just have the playerAdded event as this

game.Players.PlayerAdded:connect(function(p)
leaderstats = Instance.new("Folder",p)
p.Name = "leaderstats"
b = Instance.new("Intvalue",leaderstats)
b.Value = countyay()
end)
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
20 Feb 2015 10:37 AM
im sorry but


"Output: i dont know becuse it crashes"


that is the best line I've ever heard in a while lol
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