So, I am trying to make a dialog GUI its supposed to only appear for the player who clicks the torso of the dummy but instead it does it for all players and i cant use local player and, I have tried quite a few things but it doesn't even give me a error if you could help me out then thank you
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | local CommLog = Instance.new( "ScreenGui" ) |
03 | local Text = Instance.new( "Frame" ) |
04 | local wow = Instance.new( "TextLabel" ) |
05 |
06 | local function onClicked() |
07 | workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 0 |
08 | game.Players.name.Character.Humanoid.WalkSpeed = 0 |
09 | Text.Visible = true |
10 | wow.Text = "H" |
11 | wait( 0.30 ) |
12 | wow.Text = "Hi" |
13 | wait( 4 ) |
14 | Text.Visible = false |
15 | wow.Text = "" |
RemoteEvent Time! Make a 2 RemoteEvents in Rep. and name them "Event1" and "Event2" Server Script:
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | local Event = game:GetService( "ReplicatedStorage" ).Event |
03 | local Event 2 = game:GetService( "ReplicatedStorage" ).Event 2 |
04 | game.Workspace.Dummy.Torso.ClickDetector.MouseClick:Connect( function () |
05 | game.Workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 0 |
06 | Event:FireClient(player) |
07 | end ) |
08 | Event 2. OnServerEvent:Connect( function () |
09 | game.Workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 32 |
10 | end ) |
11 | end ) |
Client Script:
01 | game:GetService( "ReplicatedStorage" ).Event.OnClientEvent:Connect( function () |
02 | local CommLog = Instance.new( "ScreenGui" ) |
03 | CommLog.Name = "CommLog" |
04 | CommLog.Parent = game.Players.LocalPlayer.PlayerGui |
05 | local Text = Instance.new( "Frame" , CommLog) |
06 | Text.Name = "Text" |
07 | Text.Visible = false |
08 | local wow = Instance.new( "TextLabel" , Text) |
09 | wow.Name = "wow" |
10 |
11 |
12 | game.Players.LocalPlayer.Humanoid.WalkSpeed = 0 |
13 | Text.Visible = true |
14 | wow.Text = "H" |
15 | wait(. 3 ) |
Try this. If it doesn't work or u dont understand, then leave a comment. Im going to bed now.