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

How would I make the dialogue GUI show locally for a single player and not the whole server?

Asked by 4 years ago

Do you know how Roblox story games have the dialogue box? Well, that shows for the whole server. My game is similar but it's an RPG, so players will usually be progressing on their own time. Therefore, I need the dialogue to show locally: only for a single player. How would I accomplish this?

0
Use LocalScripts to make the GUI appear for the player. RazzyPlayz 497 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

there are multiple ways to accomplish the thing you want, but i am going to go with the easy way:

if you already have a placeholder dialogue gui in the player's playergui, you can fire a remote to only that client with the specific strings and other data you may need.

01--[[the "replication" method, may be slow because you are doing .touched on the server but more reliable since exploiters are unable to fire touch interests on the client]]--
02-- local
03local remote = workspace.remote -- some location
04remote.OnClientEvent:Connect(function(strings,...)
05    -- "strings" can either be a table of strings or a single string
06    local args = {...}
07    -- do gui stuff here
08end)
09 
10-- server
11local remote = workspace.remote
12local someplatform = workspace.Part
13someplatform.Touched:Connect(function(p)
14    local plr = game:GetService("Players"):GetPlayerFromCharacter(p.Parent)
15    remote:FireClient(plr,{"hi","what"},somethingidk)
View all 23 lines...

keep in mind exploiters can use a basic function to fire all touch interests so i would use something like region3 but .touched still works well

Ad

Answer this question