Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A dialogue system when you touch a part?

Asked by 6 years ago

Anyone know a simple way of making text appear in a screengui at the bottom of the player's screen, only for the player who touched the part? And when they stop touching the part, the text would disappear? Also, I don't know how to put a "click to continue" script for the dialogue. Can someone teach me how?

2 answers

Log in to vote
0
Answered by 6 years ago

Use a normal script then put your GUI inside the script. Just type:

local gui = script.Gui
local touched = false
--whatever the part where the players want to touch--
script.Parent.Parent.Block.Touched:connect(function(p)
if not touched then
touched = true
if p.Parent:FindFirstChild('Humanoid') then
gui:Clone().Parent=game.Players[p.Parent.Name].PlayerGui
wait(3)
end
touched=false
end
end)

script.Parent.Parent.Block.TouchedEnded:connect(function(p)
game.Players[p.Parent.Name].PlayerGui:WaitForChild('Gui'):Destroy()
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Make a Local script inside of StarterPlayer -> StarterPlayerScripts. Then add a RemoteEvent to ReplicatedStorage. After that add a LocalScript inside of StarterGui. Finally, Make a part in workspace.

Local Script for StarterPlayerScripts:

local Target = game.Workspace.Brick -- Brick is the Part's Name.
local PlrGui = game.Players.LocalPlayer.PlayerGui
game.ReplicatedStorage.RemoteEvent:FireServer()
Target.Touched:Connect(function()
    PlrGui.ScreenGui.Frame:TweenPosition(UDim2.new(0,0,0.899,0),"Out","Bounce",5) -- This makes the Text slide out and bounce into place. The 5 is how long the "Animation" will take.
Target.TouchEnded:connect(function()
    PlrGui.ScreenGui.Frame:TweenPosition(UDim2.new(-1,0,0.899,0),"In","Quad",5) -- This makes the Text slide in and be out of the players way.
end)
end)

Then after that inside of StarterGui's Local script put

game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(function() -- Just fires the server up

end)

Now, that it's all done press play, Stand on the brick, and then wait a few second and step off. Hope this works for you.

0
Forgot to add the fact of the button if you still need that LMK Zerixa_RBLX -2 — 6y

Answer this question