First of all, this code should be in a LocalScript inside of the button. Second, connect is deprecated. Use Connect instead. Also, you typed "(function()" incorrectly. It shouldn't be "(function)", it should be "(function()". Finally, GUIs shouldn't be changed with a server-side script. Here is what your code should look like:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.TextLabel.Text = "You are now a zombie"
end)
The "script.Parent.Parent.TextLabel" part of the code may not be correct, as I do not know where the TextLabel is located. If that isn't where the TextLabel is located in reference to the script, change it to the correct location. Anyway, I hope this helps! Good luck!
1 comment
Don't remind users to accept your answer. It is nature for the asker to accept it. It's just greedy.