Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Message = game.ReplicatedStorage:WaitForChild("Message")
- local Speaker = Message:WaitForChild("Speaker")
- 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.PlayerFrame.PlayerFrame.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.PlayerFrame.PlayerFrame.Icon.WorldModel
- end
- end
- wait()
- DialogueFrame.PlayerFrame.PlayerFrame.Icon.CurrentCamera = camera
- camera.CFrame = DialogueFrame.PlayerFrame.PlayerFrame.Icon.WorldModel.Head.CFrame * CFrame.new(0, 0.2, -2) * CFrame.Angles(0, math.rad(180), 0)
- end
- function AnimateText(text)
- script.DialogueSound:Play()
- DialogueFrame.DialogueFrame.Message.Text = text
- end
- HideDialogueEvent.OnClientEvent:Connect(function()
- DialogueFrame:TweenPosition(UDim2.new(0.55,0,-1,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
- end)
- Message:GetPropertyChangedSignal("Value"):Connect(function()
- AnimateText(Message.Value)
- end)
- Speaker:GetPropertyChangedSignal("Value"):Connect(function()
- DialogueFrame:TweenPosition(UDim2.new(0.55,0,0.15,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
- print("New Speaker: "..Speaker.Value)
- UpdateCharacter3(workspace[Speaker.Value])
- DialogueFrame.PlayerFrame.PlayerFrame.Icon.nameLabel.Text = Speaker.Value
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement