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

Help with a unexpected symbol?(unexpected symbol near '.')

Asked by 9 years ago

I felt lazy to make a buttons from a script so I used a plugin that generates objects into a script and then I edited some properties to my liking and I got a error saying:

Workspace.ButtonCreator:4: unexpected symbol near '.'

Is it me who did this wrong or the plugin itself?

If it was me why did I get an error if i'm using the right symbol to access a property?

How do I fix it?

function CreateButtons()
----------------------Button----------------------
local Button = Instance.new("TextButton",game.PlayerGui.ScreenGui)
local Button.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
local Button.Size = UDim2.new(0.2, 0,0.14, 0)
local Button.Text = "PlayerName"
local Button.Name = "Button"
local Button.Position = UDim2.new(0.08,0,0.13,0)
----------------------ButtonUnderImage----------------------
local Buttonunderimage = Instance.new("Frame",game.PlayerGui.ScreenGui)
local Buttonunderimage.Style = Enum.FrameStyle.DropShadow
local Buttonunderimage.Size = UDim2.new(0,0,0.13,0)
local Buttonunderimage.Name = "ButtonUnderImage"
local Buttonunderimage.Position = UDim2.new(0.08,0},{0.14,0)
----------------------PlayerImage----------------------
local PlayerImage = Instance.new("ImageLabel",game.PlayerGui.ScreenGui)
local PlayerImage.BackgroundTransparency = 1
local PlayerImage.Image = "rbxassetid://"
local PlayerImage.Name = "PlayerImage"
local PlayerImage.Position = UDim2.new(0,0,0.13,0)
local PlayerImage.Size = UDim2.new(0.08,0,0.14,0)
end
CreateButtons()

0
What is 'game.PlayerGui.ScreenGui'? Do you mean 'game.CoreGui', 'game.StarterGui', or 'game.Players.LocalPlayer.PlayerGui' [I'm not too sure how the script works, so I'm taking guesses on what 'game.PlayerGui.ScreenGui' means]? TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I think your problem is the button is not given a valid parent. Since this is a plugin (I think), you want the button to be in CoreGui. Do this for line 3:

local Button = Instance.new("TextButton", game.CoreGui)
Ad

Answer this question