Advertisement
HowToRoblox

GameClient

Nov 18th, 2022 (edited)
1,550
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 1 0
  1. local plr = game.Players.LocalPlayer
  2. local plrGui = plr:WaitForChild("PlayerGui")
  3.  
  4. local statusLabel = plrGui:WaitForChild("StatusGui"):WaitForChild("StatusLabel")
  5.  
  6. local rs = game.ReplicatedStorage:WaitForChild("MurderMysteryReplicatedStorage")
  7. local re = rs:WaitForChild("RemoteEvent")
  8. local config = require(rs:WaitForChild("CONFIGURATION"))
  9. local status = rs:WaitForChild("STATUS")
  10.  
  11.  
  12. function updateStatus()
  13.     statusLabel.Text = status.Value
  14. end
  15. updateStatus()
  16.  
  17. local updateStatusConnection = status:GetPropertyChangedSignal("Value"):Connect(updateStatus)
  18.  
  19.  
  20. re.OnClientEvent:Connect(function(instruction, value1, value2)
  21.    
  22.     if instruction == "DATA FAILED TO LOAD" then
  23.         updateStatusConnection:Disconnect()
  24.        
  25.         statusLabel.Text = "Your data failed to load. Any progress from this session will be lost once you rejoin."
  26.         statusLabel.TextColor3 = Color3.fromRGB(255, 199, 56)
  27.        
  28.     elseif instruction == "ROLE CHOSEN" then
  29.         statusLabel.Text = "Your role is " .. value1
  30.        
  31.        
  32.     elseif instruction == "DUMMY KNIFE" then
  33.        
  34.         local knifeClone = value1:Clone()
  35.         knifeClone.Transparency = 0
  36.        
  37.         knifeClone.Velocity = value2
  38.  
  39.         knifeClone.Parent = workspace
  40.        
  41.         local knifeCFrame = CFrame.new(value1.Handle.Position, value2)
  42.         knifeClone.CFrame = knifeCFrame
  43.  
  44.         local bav = Instance.new("BodyAngularVelocity")
  45.         bav.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  46.  
  47.         bav.AngularVelocity = knifeCFrame:VectorToWorldSpace(Vector3.new(-config.MurdererWeaponRotationalVelocity, 0, 0))
  48.         bav.Parent = knifeClone
  49.        
  50.         knifeClone.Touched:Connect(function(hit)
  51.             if hit.Parent ~= value1.Parent and hit.Parent.Parent ~= value1.Parent then 
  52.  
  53.                 knifeClone:Destroy()
  54.             end
  55.         end)
  56.     end
  57. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement