So the title says it all. I’m make a game but this part script isn’t working It’s supposed to make a cutscene but however, the output, concerning the script just says: “Attempt to index nil with Character”
Here’s the Part’s script:
local Part = script.Parent
local Door = script.Parent.Parent.Door
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Cutscene = Character.WaitForChild("Cutscene")
local TS = game:GetService("TweenService")--Forget that
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)--Forget that
local Properties = {Position = Vector3.new(965.44, 23.039, -0.87)}--Forget that
local Tween = TS:Create(Cutscene, tweenInfo, Properties)--Forget that
Part.Touched:Connect(function()
Tween:Play()
Door.CanCollide = true
end)
You can’t access the localplayer from a server script(If you are doing this from a server script). You can only access the localplayer through a local script
You can either make the script client sided and use a local script
Or
You can fire a remote event when the player touches the part and then have a local script listen for when the client is fired. You will than have it play the tween and do whatever else you need to do on the client.
Workspace.Script:3: attempt to index nil with ‘Character’
then it HAS to be because you did a script. You need what is called a LOCAL Script which is why your code isn’t running. I did a test run just to make sure and I got the EXACT same error so I am pretty sure that this is what is happening