Why my script don't working

This is my script its a normal script

script.Parent.MouseButton1Click:Connect(function()
game.Players.PlayerAdded:Connect(function(player)
	local Character = player.Character or player.CharacterAdded:Wait()
	player.PlayerGui.StartGui.Enabled = false
	Character.MoveScript.Disabled = false
		player.PlayerGui.ScoreGui.Enabled = true
		player.PlayerGui.ScoreGui.ScoreButton.ScoreScriptServer.Disabled = false
		print("eeeeeee")
	end)
end)

No there is no output massages

Try this:

local player = script:FindFirstAncestorWhichIsA("Player")

script.Parent.MouseButton1Click:Connect(function()
	local Character = player.Character or player.CharacterAdded:Wait()
	player.PlayerGui.StartGui.Enabled = false
	Character.MoveScript.Disabled = false
	player.PlayerGui.ScoreGui.Enabled = true
	player.PlayerGui.ScoreGui.ScoreButton.ScoreScriptServer.Disabled = false
	print("eeeeeee")
end)
1 Like

Output massage

Players.MONSTERGAMES3609.PlayerGui.StartGui.ImageLabel.PlayButton.Script:2: attempt to index nil with ‘Character’

Sorry I edit the reply check it againl.

1 Like

Another output massage

Expected ‘:’ not ‘.’ calling member function FindFirstAncestorWhichIsA

local player = script:FindFirstAncestorWhichIsA(“Player”)
not
local player = script.FindFirstAncestorWhichIsA(“Player”)

Sorry I edit the reply check it again. Two times.

1 Like

Use a local script for playergui stuffs
Normal scripts wont work

Tysm bro that work.

(Extra Characters)