|
| 03 Apr 2017 12:07 PM |
Whenever I try to post something it seems to format everything to one line and not allow multiples
I know technically not a scripting question, but I have one to ask and my code keeps getting messed up in format.
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:08 PM |
| Post it on a site like pastebin and link us here, make sure to leave out the doht cohm |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:09 PM |
Ye I end up doing that, wasn't sure what glitches on this site tho for some people it seems fine
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:11 PM |
| It's not a glitch, it's just Roblox's awful censorship moderation bot that turns your code into a bunch of nasty hashtags and for some reason destroys all formatting because they don't know the bytecode for the Enter key. |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 03 Apr 2017 12:11 PM |
It's due to reformatting from the filtering system, not a glitch. If nothing gets filtered (you can check this by clicking Preview before posting) then it won't happen. Or just use Pastebin.
112,859 slices of pizza and counting! |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:11 PM |
OH! Cheers.
If I remove the # before it posts it fixes the formatting
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 03 Apr 2017 12:12 PM |
no
112,859 slices of pizza and counting! |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:13 PM |
| Fun fact: sometimes if your stuff gets censored, it will be hashed but it won't always ruin formatting |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 03 Apr 2017 12:13 PM |
oh wait I get you. Thought you meant literally remove the "#s"
Yeah. As long as no content of your post is going to be filtered it's fine.
112,859 slices of pizza and counting! |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 03 Apr 2017 12:13 PM |
sometimes it only removes the following line break
112,859 slices of pizza and counting! |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:14 PM |
Technically literally removing the #'s would work Unless your new resulting word combination was deemed explicit by the filter |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:14 PM |
ye like I had a roblox asset ID that was breaking, but if I change the link to something else it works
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:15 PM |
But speaking through this I fixed my problem anyway xD
I was running a pcall on 2 scripts and was doing the same in the 3rd, then realised that it couldn't actually error in the first place which is why it broke
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 03 Apr 2017 12:15 PM |
When you compose your post, press the preview button to see what parts of your post when be censored, and the alt-left arrow to go back to fix your post if need be.
Sometimes it's kinda obvious why something might be censored, i.e. long streams of numbers are generally blocked because they might be numeros de telephono. Other times it's not, like occasionally censor blocks the, as, etc. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:17 PM |
| Pcall just tells you if a function errors, but they don't require an error to return success = true |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:17 PM |
No yeah I know, before if something wasn't true it would error, but for this time it wouldn't error and just return a different result meaning I didn't need pcall.
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
|
|
| 03 Apr 2017 12:21 PM |
#code local purchaseID = script.Parent.ID.Value function checkID() if purchaseID ~= 0 then return true end end local check = pcall(checkID) while true do if not check then wait(0.01) check = pcall(checkID) else break end end
Was using something similar to this to check if a NumberValue contained a 0. For the above case, it would error due to another script taking 1 off the ID, thus meaning the ID was -1 or something, creating an error
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:26 PM |
| Instead of a NumberValue, use an IntValue because it's impossible for an ID to be anything other than an integer. After a change is made to that value, as if the value is < 0, if so, set it to 0. Or, instead of an IntValue and checking for 0, consider an IntConstrainedValue, setting min to 0 and max to math.huge or as high as you can go #################################################################### |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:27 PM |
Agh, * Instead of a NumberValue, use an IntValue because it's impossible for an ID to be anything other than an integer. After a change is made to that value, if the value is < 0, if so, set it to 0.
Or, instead of an IntValue and checking for 0, consider an IntConstrainedValue, setting min to 0 and max to math.huge or as high as you can go:
wiki.roblox.com/index.php?title=API:Class/IntConstrainedValue
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:30 PM |
Sorry for spam, I'm really out of it today.
script.Parent.ID.Value.Changed:connect(function(newVal) val = newVal-1 if val <0 then val = 0 end print(val) end)
|
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 12:33 PM |
Everything I have got should work now anyway so I'll leave it, but will change from NumberValue to IntegerValue :)
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 12:49 PM |
From what I can tell you're polling in that while-true-do loop instead of detecting the changed event, which isn't an ideal setup. Do consider the alternative :S |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2017 01:02 PM |
nvm it was nothing to do with -1 since that happens after for something else
#code dbLocation = 3 -- Don't need to edit below function waitDatabase() if (#_G.db ~= 0) then return true end end local check = pcall(waitDatabase) while true do if not check then wait(0.01) check = pcall(waitDatabase) else script.Parent.ID.Value = _G.db[dbLocation][2] return false end end is what I needed the pcall for
r+://718058112r+://718058837 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 03 Apr 2017 01:05 PM |
Sounds like you just want something simpler, like
repeat wait() print(tick()) until #_G.db ~= 0 print(#_G.db) |
|
|
| Report Abuse |
|
|