The part triggered but i didnt touch it

  1. What i want: A script that send dialogue when a part is touched
  2. The problem: when i dont touch the part, it still triggered the script. but when somehow it didnt and try to touch it, it didnt work
  3. What i did trying to solve the problem: Asking ChatGPT for help :wilted_flower:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DialogueRemote = ReplicatedStorage.Storage.Events.Remote:WaitForChild("DialogueRemote")
local AlreadyChat = false

script.Parent.Touched:Connect(function(hit)
	local character = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	if player and character:FindFirstChild("Humanoid") then
		if not AlreadyChat then
			AlreadyChat = true
			DialogueRemote:FireAllClients({
				"Great![delay:1] you made it",
				"even tho its easy...",
				"Anyway...[delay:1] this is the 2nd tutorial!",
				"You can ledge climb by jump and press space to ledge climb",
				"do not eat the edge of the platform[delay:1] its not edible",
				"Now continue"
			})
		else
			return
		end
	end
end)

idk what to do, all i do become didnt work.

2 Likes

I had a problem with anything that returns a part when hit, when trying to use characters.
The problem is basically that if I touch it with an accessory, the parent isn’t actually the model. I fixed this by using:

local character = hit:FindFirstAncestorWhichIsA("Model")

I don’t really know what to answer, you could make more debug prints in your scripts. For example, try to print hit, then find it in the explorer.

1 Like