Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Error in start GUI?

I was making a start GUI for my game, but when I tested it it said "Attempt to call a string value" Here's the script:

Player = game.Players.LocalPlayer
Background = script.Parent.Parent:WaitForChild("Background")
Play = script.Parent

function OnClicked()
	Background.Visible = false
end

Play.MouseButton1Down:connect("OnClicked")


Thanks!

2 answers

✓ Accepted answer

Error on line 9 should be

Play.MouseButton1Down:connect(OnClicked)-- no abbreviations needed because it's a unctions name not string

1 comment

0

Thanks, idk why i put that :P

Change this:

Play.MouseButton1Down:connect("OnClicked")

to this:

Play.MouseButton1Down:connect(OnClicked)

You put a string value, into the :connect function. It won't work, because that doesn't receive strings. It can only be just the name of a function like that. Hope it works, and I also hope I helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.