Advertisement
Sungmingamerpro13

New DialogueScript Update (SungExetior13RBLX Style)

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