#Help with jumpscare
8 messages · Page 1 of 1 (latest)
Code: game.ReplicatedStorage.BookOpen.Event:Connect(function(plr) print(plr) local plrModel = plr.Character print(plrModel.Name, "Triggered The Prompt!") plrModel.HumanoidRootPart.Anchored = true plrModel.Head.Anchored = true while plrModel:FindFirstChildWhichIsA("Humanoid").Health > 0 do plrModel.PrimaryPart = plrModel.Head plr.CameraMode = Enum.CameraMode.LockFirstPerson wait(3) local jumpscare = game.Workspace.Library.Jumpscare:Clone() jumpscare:PivotTo(plrModel:GetPivot() * CFrame.new(0, 0, 2.5)) wait(1) local clone = game.StarterGui.ScreenGui.BlackOut:Clone() clone.BackgroundTransparency = 0 clone.Parent = plr.PlayerGui wait(2) if plrModel:FindFirstChildWhichIsA("Humanoid") then plrModel:FindFirstChildWhichIsA("Humanoid").Health = 0 wait(0.5) end clone:Destroy() game.Workspace.Library.Jumpscare.Head.CFrame = plrModel.Head.CFrame wait() end plrModel.HumanoidRootPart.Anchored = false plrModel.Head.Anchored = false end)
.Event seems like a remote event but you are using :Connect(function(plr) which wont work, since it is .Event.OnServerEvent:Connect(function(). Also if this is from a client script the it is OnClientEvent.
Thanks, but can I get some additional info like how to fix it? (Sorry I'm an noob programmer)
What type of script is it? Is it the serverside script (white script) or a local script (blue script) ?
@safe summit It's a serverside script
Then you need to do OnClientEvent.
It printed out my roblox name, but the jumpscare thingy keeps on spawning in my back.