I’m currently making a talking system with the value “IsTalking” (boolvalue) within the player’s character. It works for the first half, but attempting exiting the dialogue results in the dialogue box closing, but the player being stuck in place.
Here’s the error:
I’m not sure of what the script’s parent is, but it look like MouseButton1Down takes a parameter that is a number, not a player. If this is in a local script, you can just get the player’s character by writing: game.Players.LocalPlayer.Character
I tried this, but it didn’t seem to work. I’m not the most familiar with how RemoteEvents work, but I somewhat understand how to use them. I put this into a LocalScript:
script.Parent.MouseButton1Down:Connect(function(plr)
plr.Character.IsTalking.Value = false
local exit = game.ReplicatedStorage:WaitForChild("ChallengeDialogueExited")
exit:FireServer()
end)
And this into a Script inside the RemoteEvent, which in turn is inside ReplicatedStorage:
script.Parent.OnServerEvent:Connect(function()
game.Workspace.Race:Play()
local flag = game.ServerStorage.Flag:Clone()
flag.Parent = workspace
game.Workspace.Test.ClickPart:Destroy()
end)
The flag is for a race mission, touching it will end the race. The Race sound is the music for the race.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:Connect(function()
player.Character.IsTalking.Value = false
local exit = game.ReplicatedStorage:WaitForChild("ChallengeDialogueExited")
exit:FireServer()
end)