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: Badge awarding part broken, script running. Bam!

Previous Thread :: Next Thread 
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 09:42 AM
Hello scripters and newcomers of all names and ROBLOX experiences.

I am currently working on this place when I feel like etcetera.

Yeah, I have experienced something strange, as I've... ok, REMS (Remote Error Monitoring System) don't report any errors, I'm using a normal (server-sided) Script, and everything seems fine except for the fact that I'm not getting an ypcall-tagged error, which should report when someone earned a badge.

I have modified the script and excluded functions and stuff not relevant for this problem.
So yeah, tell me what you find that could block the TWO AwardBadge-functions.

Also, I used an alt in multiplayer-mode, nothing should error, and don't say some of the stuff I just said couldn't happen, like "Lolo, you probably used solo modeh, data persistencah blok'd eet".

Script:
---------------------------------------------------------------------------------------------------------------
if not workspace:FindFirstChild("WPMdatabasehehe") then
Instance.new("Configuration", workspace).Name = "WPMdatabasehehe"
end

local folder = workspace:FindFirstChild("WPMdatabasehehe")
local b = game:service("BadgeService")

local awards = {[80] = 113577049}

function prepareAward(item)
local plr = game:service("Players"):FindFirstChild(tostring(item))
if plr and plr:IsA("Player") and tonumber(item.Value) then
ypcall(function()
coroutine.wrap(function()
plr:WaitForDataReady()
plr:SaveNumber("savedWPM", tonumber(item.Value) or 0)
end)()
end)
pcall(function()
for w,id in pairs(awards) do
if tonumber(item.Value) >= w and not b:UserHasBadge(plr.userId, id) then
ypcall(function()
print(("Awarding badge: " .. plr.userId .. ", " .. id), 0)
end)
b:AwardBadge(plr.userId, id)
end
end
end)
end
end

game:service("Players").PlayerAdded:connect(function(newPlr)
local findScore = folder:FindFirstChild(tostring(newPlr))
ypcall(function()
coroutine.wrap(function()
--newPlr:WaitForDataReady()
local checkWPM = 10 --newPlr:LoadNumber("savedWPM")
if removal[tostring(newPlr)] == checkWPM then
--newPlr:SaveNumber("savedWPM", 0)
if folder:FindFirstChild(tostring(newPlr)) then
folder:FindFirstChild(tostring(newPlr)):Destroy()
end
end
end)()
end)
if findScore then
pcall(function()
for w,id in pairs(awards) do
if tonumber(item.Value) >= w and not b:UserHasBadge(newPlr.userId, id) then
print(("Awarding badge: " .. newPlr.userId .. ", " .. id), 0)
b:AwardBadge(newPlr.userId, id)
end
end
end)
end
end)

function checkStatus(item)
if item:IsA("StringValue") then
item.Changed:connect(function()
prepareAward(item)
end)
prepareAward(item)
end
end

folder.ChildAdded:connect(checkStatus)

for _,c in pairs(folder:GetChildren()) do
checkStatus(c)
end
---------------------------------------------------------------------------------------------------------------


- As, meep diz iz unleh 71 lines. Or is it? 130 lines without censoring.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 09:44 AM
Woops, forgot to change print to error. It is changed in the current version of the game.


- As, 100% usage of burning wood.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 10:07 AM
Sorry, I should have used another name as subject.

Still, anyone got some ideas on what the problem could be?

^ PBS, look:
http://www.roblox.com/Writing-Speed-Test-place?id=113194856



- As, What's before the ROBLOX Forum?
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 10:18 AM
Tell me...


Don't you answer because you're just as confused as me, or do you just ignore my post?

Could it be that you eat a cookie and jump from forum to forum, without realizing my enormous problem?


- As... that reminds me... I have to get a cookie :D
Report Abuse
dmjoe is not online. dmjoe
Joined: 01 May 2009
Total Posts: 2387
24 Apr 2013 10:21 AM
I want to help you, but I am nowhere near at your level.

~print("pew")~
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 10:26 AM
Noooooo.... wait, isn't that a ROBLOX user? Idk how many o's.


My magnificent brain has made me unable to communicate with the human beings on Earth. I am panicking.


Should I try invite other top-of-the-skyscraper peeps from Scripters? Nah, they might not want to, and probably they will. Dunno if it's against the ROBLOX rules.


- As, hardcore sun man... it stays up to 8'o'clock!
Report Abuse
dmjoe is not online. dmjoe
Joined: 01 May 2009
Total Posts: 2387
24 Apr 2013 10:33 AM
Meh, check your ends or something.

~print("pew")~
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 10:34 AM
But... then the REMS would report an error D:

Syntax, no problem.

Logic, no problem.

Jinx, problem.

- As, no problem.
Report Abuse
KeyUp is not online. KeyUp
Joined: 17 Mar 2013
Total Posts: 457
24 Apr 2013 11:06 AM
[ Content Deleted ]
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
24 Apr 2013 11:08 AM
tl;dr

q.q
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 11:10 AM
Then just look on the script and find any possible... errors... excluding the "error" function, which just shouts ERROR! < not literally.

- As, does literally come from liter and rally? Fun if it did.
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
24 Apr 2013 11:16 AM
ok um i dont c any errurs. :L
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Apr 2013 11:24 AM
I don't see anything that stands out, but there are plenty of things that could go silently wrong, maybe just throw some prints all throughout the script and find where it's getting stuck or something? :\
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 11:29 AM
Hm, yea, dunno why I thought of that before, but didn't do it.

D: Tell me what could go "silently wrong"...


- As, we want fancy blue text for custom text :3 not just stuff like table.insert, math.random ect.
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Apr 2013 11:33 AM
well, i've had :WaitForDataReady() get stuck on me before, but that could just be me and my lack of experience in DP, or maybe the conditions for one of the if statements hasn't been met for some magical reason, i dunno :p
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 11:38 AM
Hm, the DP stuff is located in a coroutine, and should not stop the badge-stuff from working...

I am worried that it might be something before that, blocking both DP and badge-stuff... Then that's awful, blocking everyone not in the top-100 D:


- As, if magic() then print("MAGIC OMGZ") end
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 11:58 AM
Workspace.BadgeHandler, line 92
String expected

Workspace.BadgeHandler, line 124
attempt to compare number with nil

--> warning, the errors above do not match the version of the script posted above.

The first error is this line:
fHs.Value = pcall(function() return tostring(newPlr:LoadNumber("WPMstorage")) end) or "0"

I think adding parenthesis will fix it. ^

The second error is this line:
table.sort(getFastest, function(a, b) return tonumber(a.Value) > tonumber(b.Value) end)

Meaning that one of the scores have been jinxed and is no longer a number. EXPLAIN!

^ I will loop through the scores and find the one(s) which aren't a number. Let's see...



- As, this case is getting more and more weird.
Report Abuse
alliancer is not online. alliancer
Joined: 18 Mar 2013
Total Posts: 1016
24 Apr 2013 12:56 PM
this is some advanced stuff, you should ask some pros

while wait(1) do print("alliancer waz here") end
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 01:02 PM
Found out why the two lines were erroring.

Somehow, your score can turn into "" (empty string)... what a mess, and it's returning. I have added output-stuff on the LocalScript too, as well as located the only part where the score can be "" for just a second or two... and re-arranged it, so it's no longer possible.

Let's see if it's going to be fixed then xP


- As, but it's fun throwing ro-peds into a volcanooo D:
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Apr 2013 01:06 PM
@alliancer,

but this doesn't belong to Scripters, as it's a broken script that needs to work D:


So yeah, I've made a dimensional link-transmitter device in the Scripters for... dimension... linking to this part of the Scripting Helpers dimension.


:] Can I get someone to... no, I'll use mah alt :<

- As, data persistence... is it real-time?
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
25 Apr 2013 03:52 AM
-------------------------------------------------------------------------------------
This line:

if tonumber(item.Value) >= w and not b:UserHasBadge(newPlr.userId, id) then
-------------------------------------------------------------------------------------

In the function "RestoreCheck".

item doesn't exist, I should use FindScore instead :P Backfiring pcall D: Smack my head.


- As, my alt, As8DGameTest was the first player to get ze badge. Doesn't count though.
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