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

On Entered player only works in studio?

Asked by 8 years ago

I have a script that when your in studio and you test it does what it is suppose to. :D But when I go to actually play the game, it doesn't. It doesn't do anything actually...

Here is the script:

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

function onPlayerEntered(player)
    wait()
    repeat wait () until player.Character:WaitForChild("Torso")
    local new_script = script.CutsceneScript:clone()
    new_script.Parent = player.Character
    new_script.Disabled = false
end

game.Players.PlayerAdded:connect(onPlayerEntered)
onPlayerEntered(game.Players:WaitForChild("player"))

1 answer

Log in to vote
0
Answered by
iSvenDerp 233 Moderation Voter
8 years ago

We'll since this is a cutscenes script you are using local player so this has to be in local script because it's single in studio so put it in a local script(try server script if already local)

0
Its a regular script, ill try a local script and see how it works, thanks. CarterTheHippo 120 — 8y
0
I tried placing it in starter player but didnt work, then i placed it into workspace (I didnt think it would work) and it didnt. Is there a way i should rescript (reword) this to make it fit better? CarterTheHippo 120 — 8y
0
No problem tell me if it works because t should since it's locally iSvenDerp 233 — 8y
0
didnt work sadly CarterTheHippo 120 — 8y
View all comments (4 more)
0
Sorry I think I know the problem your problem your script isn't set up locally and I would love to edit it for u but I gtg but that should give u enough Ido to fix it iSvenDerp 233 — 8y
0
I figured out the actual problem, the script actually works, but the script pasted doesnt. CarterTheHippo 120 — 8y
0
It works now, Now i just need to figure out how to make it wait till player is ready, because if you dont have bc sometimes advertisements can get in the way of you viewing the cutscene CarterTheHippo 120 — 8y
0
Great! I though it did feel free to upvote if u want! iSvenDerp 233 — 8y
Ad

Answer this question