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

Unexpected Symbol near '?'

Asked by 5 years ago
Edited 5 years ago

Alright, so In this script I'm getting the error "Unexpected Symbol near '?' " It doesn't tell me where it is. I'm doing this script where i equip a tool a gui pops up and when I unequip it, it disappears. Any help would be appreciated! Thank you for your time.

Script:

Tool = script.Parent



function onEquippedLocal()

local character = script.Parent.Parent

local player = game.Players:GetPlayerFromCharacter(character)

if player==nil then return end

guiMain = script.Parent.ScreenGui:clone()

guiMain.Parent = player.PlayerGui

end





function onUneqippedLocal()

guiMain:Remove()

end





Tool.Equipped:connect(onEquippedLocal)

Tool.Unequipped:connect(onUnequippedLocal)
0
code block please Fad99 286 — 5y
0
Sorry about that, I just added it in the post. luckyfern62 0 — 5y
0
It didn't give you the line on which the error occurred but you're sure it's this script? My first guess is that it's your guiMain variable. You should at least declare it outside of your onEquippedLocal function. BlueGrovyle 278 — 5y
0
I just did that but unfortunately it did not work. :( luckyfern62 0 — 5y
View all comments (4 more)
0
Apperantly i can't poste pictures in here?? Anyway, if you are sure the script error is in this script, (you can check it by seeing red "~~" under your text) then there should appear a black "Go to script error" button. Please click on that, and give us the error. Then we can help you more. If you want a picture how to do these steps, add me on discord: Mikeyboy#8760 where i will send a guide. MaxVerstappen_NL -5 — 5y
0
You don't need to clone and remove the gui you want to appear and disappear, you can use the boolean property, Enabled, instead. MegaManSam1 207 — 5y
0
I can write a very basic script as an example if you would like. MegaManSam1 207 — 5y
1
From the code you have given us, I don't see anything wrong with it. You sure this is all of it? Also, if you are getting an error then it will tell you exactly where and what line the error is on NinjoOnline 1146 — 5y

Answer this question