Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix these Cutscene Editor Plugin Errors?

Asked by 7 years ago
Edited 7 years ago

I added some things to the Cutscene Editor Plugin Script so that some parts will appear and sounds will play. I also added something so that the cutscene can only be done once.

local Event = 0
local Player = game.Players.LocalPlayer



cscript = script.Parent:WaitForChild("CutsceneScript")

if script.Parent:findFirstChild("SkipCutsceneGuiValue") then
    script.Parent.SkipCutsceneGuiValue.Parent = cscript
    script.Parent.SkipCutsceneGui.Parent = cscript
end

debounce = false

function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") and Event == 0 then
        Event = Event + 1
        Player.PlayerGui.Jumpscare2:Play()
        Player.PlayerGui.Jumpscare:Play()
        game.Workspace.SomeRandomGuy.Torso.Transparency = 0
        game.Workspace.SomeRandomGuy.Bruh.Transparency = 0
        game.Workspace.SomeRandomGuy.No.Transparency = 0
        wait(5)
        game.Workspace.SomeRandomGuy.Torso.Transparency = 1
        game.Workspace.SomeRandomGuy.Bruh.Transparency = 1
        game.Workspace.SomeRandomGuy.No.Transparency = 1
    elseif hit.Parent:findFirstChild("Humanoid") and Event == 1 then
        script.Parent:Remove()
    end
    if debounce == true then return end
    if hit.Parent:findFirstChild("CutsceneScript") then return end -- If theres already a cutscene running, then don't do anything.
    if not hit.Parent:findFirstChild("Humanoid") then return end -- If theres no humanoid,  then don't do anything
    if not game.Players:GetPlayerFromCharacter(hit.Parent) then return end -- If its not a player, then don't do anything.
    debounce = true
    script.Parent.BrickColor = BrickColor.new("Black")
    local cutsceneScript = cscript:clone()
    cutsceneScript.Parent = hit.Parent
    cutsceneScript.Disabled = false
    repeat wait () until cutsceneScript.Parent == nil
    wait(3)
    script.Parent.BrickColor = BrickColor.new("Dark stone grey")
    debounce = false
end

script.Parent.Touched:connect(onTouched)

Errors: Workspace.CutscenePlayer.CutsceneSender:18: attempt to index upvalue 'Player' (a nil value) line 18 Workspace.CutscenePlayer.CutsceneSender:35: attempt to index field 'Parent' (a nil value) line 35

The problem is: It doesn't play the cutscene.

0
You CAN'T access the player in a serverscript by doing: game.Players.LocalPlayer FiredDusk 1466 — 7y

Answer this question