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
 

:Destory() function not working when running in test mode

Previous Thread :: Next Thread 
sgtpappybigs is not online. sgtpappybigs
Joined: 27 Aug 2016
Total Posts: 9
01 Sep 2016 01:18 PM
Here is a quick review of the code and showing what does and doesn't work in like 4 min. What might I be running into? https://www.youtube.com/watch?v=DkBbUJ4kAxs


Report Abuse
not_luxio is not online. not_luxio
Joined: 13 Jul 2016
Total Posts: 178
01 Sep 2016 01:40 PM
Can you paste the specific portion of the code that is supposed to be destroying the blocks? It's generally difficult to work with code if it's just a video.

Also, there doesn't seem to be any errors on the client, but have you checked the server window? There's three windows that should open up when you create a debug server:
1. The server
2. Player 1
3. Player 2
Report Abuse
sgtpappybigs is not online. sgtpappybigs
Joined: 27 Aug 2016
Total Posts: 9
01 Sep 2016 04:57 PM
No errors pop for the server when the code fails... During launch I get lots of stuff, like.

17:55:36.311 - Successfully opened file - C:/Users/James/AppData/Local/Roblox/server.rbxl
17:55:55.708 - New connection from 127.0.0.1|53816

17:55:55.795 - Replication: Can't create default object of type StarterGui
17:55:55.796 - Replication: Can't create default object of type Players
Player -1 added
17:55:58.977 - New connection from 127.0.0.1|53817

17:55:59.006 - Replication: Can't create default object of type StarterGui
17:55:59.006 - Replication: Can't create default object of type Players
Player -2 added
17:55:59.675 - Uploading C:\Users\James\AppData\Local\Roblox\logs\log_4D171.txt

17:56:01.138 - Uploading C:\Users\James\AppData\Local\Roblox\logs\log_4D171_1.txt

17:56:01.934 - Uploading C:\Users\James\AppData\Local\Roblox\logs\log_4D171_CrashReporter_WatcherThreadFunc_7808.txt

17:56:02.340 - Uploading C:\Users\James\AppData\Local\Roblox\logs\log_4D171_rbx_BaseThreadPool_11520.txt

17:56:02.523 - Uploading C:\Users\James\AppData\Local\Roblox\logs\log_4D171_Roblox TaskScheduler Thread 8_7848.txt
-----------

Here is the offending code, it is crazy how .Color works, but Transparency and :Destory() do not?!?!?!?!?

game.Workspace.RebuildGameBoard.OnClientEvent:connect(function(_letterBoardArray, letterBoardList, wordList)
--clean up the board so we can rebuild it!

for index, value in ipairs(bricksArray) do
for index2, value2 in ipairs(value) do
--value2.Transparency = 1 -- this doesn't work live, ignored like :Destroy()
--value2.Color = Color3.new(25,2,12) somehow this .. mostly works live... weird.
value2:Destroy()
--print("destroy")
--print(value2)
end
end

letterBoardArray = _letterBoardArray

local player = game.Players.LocalPlayer
print(player.Name)
wordListPanel.reset()
wordListPanel.init(wordList, CFrame.new(#letterBoardArray + 2, 0, 0))

for outerloop, value in ipairs(letterBoardArray) do
innerloop = 0
local row = ''
table.insert(bricksArray, {})

local heightOffset = #letterBoardArray + 2

for innerloop, value2 in ipairs(value) do
innerloop = innerloop + 1
local brick = Instance.new("Part")
brick.Size = Vector3.new(1,1,1)
local decal = Instance.new("Decal")
decal.Parent = brick
brick.Parent = workspace.Baseplate
brick.Name = "Brk:" .. outerloop .. "-" .. innerloop
decal.Texture = Characters[value2] -- This gets the image of the letter in the character table.
brick.Anchored = true
brick.CFrame = CFrame.new(-innerloop, heightOffset - outerloop, 0)

addClickBehaviors(brick)

table.insert(bricksArray[outerloop], brick)

--store this bricks coordinates
brickCoordinatesInGrid[brick.Name] = Vector2.new(innerloop, outerloop)

row = row .. value2 .. ','
end
print(row)
end

for index, value in ipairs(wordList) do
print(value)
end
end)

---------------
Thanks for taking a look! -J
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
01 Sep 2016 04:58 PM
it is not working because it is
spelled

Destroy
or
destroy

not

Destory
Report Abuse
sgtpappybigs is not online. sgtpappybigs
Joined: 27 Aug 2016
Total Posts: 9
01 Sep 2016 05:25 PM
Wow I looked everywhere in my code and code sample to try and figure out what you found.... Yes, I did misspell it in the post heading, :)
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
01 Sep 2016 05:27 PM
lol
Report Abuse
not_luxio is not online. not_luxio
Joined: 13 Jul 2016
Total Posts: 178
01 Sep 2016 05:29 PM
Very interesting bug indeed.
It looks like you were trying to debug, was "destroy" ever printed?
Also, it looks like the line that changed .Color is commented, I'm assuming this line wasn't commented when you were testing it?
Report Abuse
sgtpappybigs is not online. sgtpappybigs
Joined: 27 Aug 2016
Total Posts: 9
01 Sep 2016 06:26 PM
Destroy prints, color changes successfully (90% of the time? like some bricks didn't get it....), transparency is ignored. I have only played with roblox / lua for a few days but these tests strongly suggest I have a memory reference to the right "part"....
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