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

Script Malfunctioning without any execuction visible in Output?

Asked by
GUN1FY 4
3 years ago

Hey, I wanted to make the Baseplate for my game and wanted to set the properties for it in the script, because I'm still new to LUA Scripting. When I attempt to Test-Play the game I cannot see any execution visible and no errors in the Script Analysis. The only thing that happens is that the Baseplate changes Colours from Black to White. The Script:

local Baseplate = script.Parent

--Manual Properties--
game.Workspace.Baseplate.Anchored = true
game.Workspace.Baseplate.BrickColor = BrickColor.new(75, 151, 75)
game.Workspace.Baseplate.Transparency = 0
game.Workspace.Baseplate.Material = Enum.Material.LeafyGrass  --Value = 1284--

And the Material doesn't change at all too.

1 answer

Log in to vote
0
Answered by 3 years ago

First of all, use the variable. If you're not planning to use the variable, you should erase it completely. Secondly, BrickColor.new() requires a string and a valid name. If the name is invalid, it will not work at all.

local baseplate = script.Parent --You should get used to camel casing. Every programmer usually does this.

baseplate.Anchored = true
baseplate.Color3 = Color3.fromRGB(75, 151, 75) --You can use Color3.new(), but the value is from 0 to 1, so you'll do to do 75/255 for example.
baseplate.Transparency = 0 --the baseplate is already opaque to begin with, not sure why you use this.
baseplate.Material = Enum.Material.LeafyGrass --value doesn't matter.
Ad

Answer this question