RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write a script that lets the part type a message to the player after being touched"
-- script for part local part = script.Parent local debounce = true local function sendMessage(player) local message = "Hello, you touched the part!" local playerGui = player:WaitForChild("PlayerGui") local messageBox = Instance.new("Message") messageBox.Parent = playerGui messageBox.Text = message messageBox.Visible = true wait(5) messageBox:Destroy() end local function onTouch(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player and debounce then debounce = false sendMessage(player) wait(3) debounce = true end end part.Touched:Connect(onTouch)