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
game.Players.PlayerAdded:Connect(function(plr) local CommLog = Instance.new("ScreenGui") local Text = Instance.new("Frame") local wow = Instance.new("TextLabel") local function onClicked() workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 0 game.Players.name.Character.Humanoid.WalkSpeed = 0 Text.Visible = true wow.Text = "H" wait(0.30) wow.Text = "Hi" wait(4) Text.Visible = false wow.Text = "" plr.Character.Humanoid.WalkSpeed = 16 workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 32 end game.Workspace.Dummy.Torso.ClickDetector.MouseClick:connect(onClicked) end)
RemoteEvent Time! Make a 2 RemoteEvents in Rep. and name them "Event1" and "Event2" Server Script:
game.Players.PlayerAdded:Connect(function(player) local Event = game:GetService("ReplicatedStorage").Event local Event2 = game:GetService("ReplicatedStorage").Event2 game.Workspace.Dummy.Torso.ClickDetector.MouseClick:Connect(function() game.Workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 0 Event:FireClient(player) end) Event2.OnServerEvent:Connect(function() game.Workspace.Dummy.Torso.ClickDetector.MaxActivationDistance = 32 end) end)
Client Script:
game:GetService("ReplicatedStorage").Event.OnClientEvent:Connect(function() local CommLog = Instance.new("ScreenGui") CommLog.Name = "CommLog" CommLog.Parent = game.Players.LocalPlayer.PlayerGui local Text = Instance.new("Frame", CommLog) Text.Name = "Text" Text.Visible = false local wow = Instance.new("TextLabel", Text) wow.Name = "wow" game.Players.LocalPlayer.Humanoid.WalkSpeed = 0 Text.Visible = true wow.Text = "H" wait(.3) wow.Text = "Hi" wait(4) Text.Visible = false wow.Text = "" game.Players.LocalPlayer.Humanoid.WalkSpeed = 16 game:GetService("ReplicatedStorage").Event2:FireServer() end end)
Try this. If it doesn't work or u dont understand, then leave a comment. Im going to bed now.