- What i want: A script that send dialogue when a part is touched
- 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
- What i did trying to solve the problem: Asking ChatGPT for help
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.