Advertisement
Sungmingamerpro13

New DialogueScript (SungExetior13RBLX Style)

Jul 14th, 2024 (edited)
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.90 KB | None | 0 0
  1. local Message = game.ReplicatedStorage:WaitForChild("Message")
  2. local Speaker = Message:WaitForChild("Speaker")
  3. local HideDialogueEvent = Message:WaitForChild("HideDialogueEvent")
  4.  
  5. local player = game.Players.LocalPlayer
  6. local DialogueFrame = player.PlayerGui:WaitForChild("DialogueGui").DialogueFrame
  7.  
  8. local camera = Instance.new("Camera", DialogueFrame)
  9.  
  10. function UpdateCharacter3(character)
  11.     for i, v in pairs(DialogueFrame.PlayerFrame.PlayerFrame.Icon.WorldModel:GetDescendants()) do
  12.         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
  13.             v:Destroy()
  14.         end
  15.  
  16.     end
  17.     for i, v in pairs(character:GetChildren()) do
  18.         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
  19.             local new = v:Clone()
  20.             new.Parent = DialogueFrame.PlayerFrame.PlayerFrame.Icon.WorldModel
  21.         end
  22.     end
  23.     wait()
  24.     DialogueFrame.PlayerFrame.PlayerFrame.Icon.CurrentCamera = camera
  25.     camera.CFrame = DialogueFrame.PlayerFrame.PlayerFrame.Icon.WorldModel.Head.CFrame * CFrame.new(0, 0.2, -2) * CFrame.Angles(0, math.rad(180), 0)
  26. end
  27.  
  28. function AnimateText(text)
  29.     script.DialogueSound:Play()
  30.     DialogueFrame.DialogueFrame.Message.Text = text
  31. end
  32.  
  33. HideDialogueEvent.OnClientEvent:Connect(function()
  34.     DialogueFrame:TweenPosition(UDim2.new(0.55,0,-1,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  35. end)
  36.  
  37. Message:GetPropertyChangedSignal("Value"):Connect(function()
  38.     AnimateText(Message.Value)
  39. end)
  40.  
  41. Speaker:GetPropertyChangedSignal("Value"):Connect(function()
  42.     DialogueFrame:TweenPosition(UDim2.new(0.55,0,0.15,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
  43.     print("New Speaker: "..Speaker.Value)
  44.    
  45.     UpdateCharacter3(workspace[Speaker.Value])
  46.     DialogueFrame.PlayerFrame.PlayerFrame.Icon.nameLabel.Text = Speaker.Value
  47. end)
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement