Im trying to make a part where when touched it will make your camera shake (also im using https://www.roblox.com/library/1461025953/Camera-Shaker because i was kinda lazy) the place where it has a red line is:
if not touched then touched = true camShake:Shake(CameraShaker.Presets.Explosion) end end
the bolded end is the problem here. What do i do now?
wait() local part = workspace.SHAKE local camera=workspace.CurrentCamera local CameraShaker = require(game.ReplicatedStorage.CameraShaker) local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame) camera.CFrame = camera.CFrame * shakeCFrame end) camShake:Start() local touched = false if not touched then touched = true camShake:Shake(CameraShaker.Presets.Explosion) end end part.touched:Connect:(touchedPart)
I don't know if I'm right, but you added an end
that is for nothing.
wait() local part = workspace.SHAKE local camera=workspace.CurrentCamera local CameraShaker = require(game.ReplicatedStorage.CameraShaker) local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame) camera.CFrame = camera.CFrame * shakeCFrame end) camShake:Start() local touched = false if not touched then touched = true camShake:Shake(CameraShaker.Presets.Explosion) end -- end <--- here part.touched:Connect:(touchedPart)
Edit: part.touched:Connect:(touchedPart) was breaking because it was written like that:
part.touched:Connect:(touchedPart)
And it must be changed to this:
part.touched:Connect(touchedPart)