Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Message = game.ReplicatedStorage:WaitForChild("Message")
- local Image = Message:WaitForChild("SpeakerImage")
- local Speaker = Message:WaitForChild("SpeakerName")
- local HideDialogueEvent = Message:WaitForChild("HideDialogueEvent")
- local player = game.Players.LocalPlayer
- local DialogueFrame = player.PlayerGui:WaitForChild("DialogueGui").DialogueFrame
- local camera = Instance.new("Camera", DialogueFrame)
- function UpdateCharacter3(character)
- for i, v in pairs(DialogueFrame.PlayerImage.Icon.WorldModel:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("BodyColors") or v:IsA("Humanoid") then
- v:Destroy()
- end
- end
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("BasePart") or v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("BodyColors") or v:IsA("Humanoid") then
- local new = v:Clone()
- new.Parent = DialogueFrame.PlayerImage.Icon.WorldModel
- end
- end
- wait()
- DialogueFrame.PlayerImage.Icon.CurrentCamera = camera
- camera.CFrame = DialogueFrame.PlayerImage.Icon.WorldModel.Head.CFrame * CFrame.new(0, 0.2, -2) * CFrame.Angles(0, math.rad(180), 0)
- end
- HideDialogueEvent.OnClientEvent:Connect(function()
- DialogueFrame:TweenPosition(UDim2.new(0.55,0,-1,0))
- end)
- Message:GetPropertyChangedSignal("Value"):Connect(function()
- DialogueFrame.Dialogue.Text = Message.Value
- script.DialogueSound:Play()
- end)
- Speaker:GetPropertyChangedSignal("Value"):Connect(function()
- DialogueFrame:TweenPosition(UDim2.new(0.55, 0,0.139, 0))
- print("New Speaker: "..Speaker.Value)
- UpdateCharacter3(workspace[Image.Value])
- DialogueFrame.PlayerImage.Icon.nameLabel.Text = Speaker.Value
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement