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

unexpected symbol near ''. how to fix?

Asked by 5 years ago

error: 18:31:15.517 - Workspace.Part.Script:2: unexpected symbol near '?'

code:

script.Parent.ClickDetector.mouseClick:connect(click)?
local function click (player)
 player.PlayerGui.Hosvi.Frame.Visible = true  
end

any help would be great.

0
Just remove the "?" and you are done :) AIphanium 124 — 5y
0
oh wait why is that there SodaZere 31 — 5y
0
the thing was invisible on my screen so i could not see it that is why. some weird character got in the script cause magic omg SodaZere 31 — 5y
0
And use ":Connect" since ":connect" is deprecated. AIphanium 124 — 5y
0
Is it? wentman 19 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

All of these are simple fixes and have been answered by Alphanium but I'll just be here to help clean your code and organize everything.

There's a "?" at the end of your function, keep those out! Also, note that ":connect" is deprecated so I recommend you using ":Connect" instead. Also you can clean up your code a bit by using the "TAB" button and by putting everything together as one.

Here's your cleaner code:

script.Parent.ClickDetector.mouseClick:Connect(function(Player)
    player.PlayerGui.Hosvi.Frame.Visible = true
end)

Again, everything has been solved by Alphanium and am just cleaning and organizing code!

Also, mark this as solved or something. I came here to help and just realized it was solved, lol!

If you have any questions or issues, please contact me. ;)

0
the symbol was invisible on my screen lol, but when copy pasted it would be a question mark SodaZere 31 — 5y
Ad

Answer this question