Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

AutowedgeCells isn't working for me?

Asked by 11 years ago

I've set up this simple plugin, and what it should do is smooth a radius of terrain around where the mouse is pointed at. It print 'Click', but doesn't smooth.

01local plugin = PluginManager():CreatePlugin()
02local toolbar = plugin:CreateToolbar("Hello World Plugin")
03local terrain = Game.Workspace.Terrain
04 
05local smoothButton = toolbar:CreateButton(
06    "Smooth",
07    "Use this to smooth an area of terrain",
08    "SmoothIcon.png"
09)
10 
11smoothButton.Click:connect(function()
12    plugin:Activate(true)
13    local mouse=plugin:GetMouse()
14    mouse.Button1Down:connect(function()
15        local mosPos = mouse.Hit
View all 22 lines...

2 answers

Log in to vote
1
Answered by
Maxomega3 106
11 years ago
01local plugin = PluginManager():CreatePlugin()
02local toolbar = plugin:CreateToolbar("Hello World Plugin")
03local terrain = Game.Workspace.Terrain
04 
05local smoothButton = toolbar:CreateButton(
06    "Smooth",
07    "Use this to smooth an area of terrain",
08    "SmoothIcon.png"
09)
10 
11smoothButton.Click:connect(function()
12    plugin:Activate(true)
13    local mouse=plugin:GetMouse()
14    mouse.Button1Down:connect(function()
15        local mosPos = mouse.Hit
View all 22 lines...

I'm not an expert in terrain, although I hope to get better. Why do you declare origin, but never index it?

0
Oh yeah, that explains it all actually. I meant to put origin instead of mosPos.p in the Region3Int16. Thanks! ColdSmoke 55 — 11y
0
Well it's still broken but I think I know where to go from here. Thanks a ton. ColdSmoke 55 — 11y
Ad
Log in to vote
-1
Answered by 11 years ago

Try this

01local plugin = PluginManager():CreatePlugin()
02local toolbar = plugin:CreateToolbar("Hello World Plugin")
03local terrain = Game.Workspace.Terrain
04 
05local smoothButton = toolbar:CreateButton(
06    "Smooth",
07    "Use this to smooth an area of terrain",
08    "SmoothIcon.png"
09)
10 
11smoothButton.Click:connect(function()
12    plugin:Activate(true)
13    local mouse=plugin:GetMouse()
14    mouse.Button1Down:connect(function()
15        local mosPos = mouse.Hit
View all 22 lines...
0
What exactly did you change? ColdSmoke 55 — 11y
0
did it work? danielsarabia11 -2 — 11y
0
It still does nothing, you gave me the exact same code I originally posted. ColdSmoke 55 — 11y
0
no i didnt try it agian and try using diffrent scripts like scripts and local scripts danielsarabia11 -2 — 11y
View all comments (2 more)
0
This is in a plugin, it doesn't have local scirpts or scripts, it's simply a Main.lua file. I see nothing different about the code you posted, and it doesn't work any better either. ColdSmoke 55 — 11y
0
ugh you must be blind this should be working like a script rather than a plug in danielsarabia11 -2 — 11y

Answer this question