What do i need to add to get the camera to reset and not end in a random place?
Asked by
4 years ago Edited 4 years ago
--//Variables
local tool = script.Parent print(1)
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local db = false
--//Equipped
tool.Equipped:Connect(function(mouse) print(2)
mouse.Button1Down:Connect(function()
if not db then
db = true
game.ReplicatedStorage.ServerEvents.ShakeEvent:FireServer()print(3)
wait(4)
db = false
end
end)
end)
game.ReplicatedStorage.ServerEvents.ShakeEvent.OnClientEvent:Connect(function() print(4)
for i = 1,100 do
local a = math.random(-100,100)/100
local b = math.random(-100,100)/100
local c = math.random(-100,100)/100
hum.CameraOffset = Vector3.new(a,b,c)
wait()
end
end)