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

Simple script fix about touching a part, can anyone see what I need to change?

About this script: If someone touches this part then a GUI will pop up(visible = true), but in this case in doesn't pop up. Can anyone please help? Thanks!

workspace.mayorTrigger.Touched:connect(function()
	print ("touched")
	script.Parent.Parent.Parent.StarterGui.buttonInteract.buttonFrameMayor.Visible = true
end)

1 answer

The script for onTouched shouldn't be in a LocalScript. Instead you should put a script in a part and make the line something such as :

script.Parent.Touched:connect(function(Hit)
	local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
	if Player then
		Player.PlayerGui.buttonInteract.buttonFrameMayor.Visislbe = true
	end
end)

2 comments

0

I put that in a regular script under my part with this code with a few changes and nothing worked

0

Thanks for helping though!

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