You are using parameters correctly, you can send them to functions and use them inside the function,, but there's a problem, everything is correct except for the color, first of all, it's part.BrickColor and not part.Brickcolor, remember: capilitization has to be correct, the second problem is that you are sending cyan which would essentially look like
part.BrickColor = cyan
Which will error, to fix it send the BrickColor to the function:
iamcool(BrickColor.new("Cyan"),false,.5)
There's one last problem, is that if you do
iamcool(BrickColor.new("Bright red")
It's gonna error because it's setting anchored and transparency to nil, so we should check if they exist first
function iamcool(brickcolor,shouldAnchor,transparency)
if brickcolor then
local part = workspace.Part
part.BrickColor = brickcolor
if shouldAnchor ~= nil then
part.Anchored = shouldAnchor
if transparency then
part.Transparency = tonumber(transparency)
end
end
end
end
So here we go
We can now set just individual properties
iamcool(BrickColor.new("Really red"))
3 comments
yes and no. You're passing a unformatted string on line 8, you have to use BrickColor.new("cyan") or "cyan"
Oh, ok I thought of that but I said “nvm” thanks!, what can I do to like yknow, accept your answer since it is a comment cuz I can not upvote?
????