Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

when a player is touched by the ability I want the camera to change.How can i fix my script?

--The function

Core.Touched:Connect(function(hit)

if hit and hit.Parent == Player.Character then return end 

if hit and hit.Parent:FindFirstChild("Humanoid") then

local Enemy = hit.Parent:FindFirstChild("Humanoid")

--Camera Cutscene

local cam = workspace.CurrentCamera

local cam = game.Workspace.CameraPart

CamTest.CameraType = Enum.CameraType.Scriptable	

cam.CameraType = "Fixed"

cam.CameraSubject = CamTest

cam.CFrame = CamTest.CFrame

cam.FieldOfView = 40

cam.Focus = CamTest.CFrame

--When Enemy Take Damage.

Enemy:TakeDamage(Damage)

Core:Destroy()

Tool.Explosion:Play()

animationTrack:Stop()

Tool.Sound:Stop()

Player.Character.Humanoid:UnequipTools()

`

1 answer

You can have the server use RemoteEvent:FireClient() to tell the client(player) that they must change the camera. Make sure that the first paremeter of FireClient is the player object.

This discussion is preserved as it was. New answers, comments, and votes are closed.