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

(Solved) (Full main script) Fire client attempt to index local 'Player' (a nil value)?

Asked by 5 years ago
Edited 5 years ago

Can you help me?

ServerScriptService - MainScript (Normal script)

001local ReplicatedStorage = game:GetService("ReplicatedStorage")
002 
003local PlrCamera = game.Workspace.CurrentCamera
004 
005local ServerStorage = game:GetService("ServerStorage")
006 
007local Status = ReplicatedStorage.Status
008 
009local Player = game:GetService("Players").LocalPlayer
010 
011local MapsFolder = game.ServerStorage.Maps
012 
013while true do
014 
015    wait(1)
View all 139 lines...

Local script - Starter Gui

01local Event = game.ReplicatedStorage.CameraKillerBox
02local Event2 = game.ReplicatedStorage.CameraKillerBoxBack
03 
04Event.OnClientEvent:Connect(function()
05    local KillerCamera = game.Workspace.CurrentCamera
06    local Player = game.Players.LocalPlayer
07 
08    repeat wait() until Player.Character
09 
10    KillerCamera.CameraType = "Scriptable"
11    KillerCamera.CFrame = game.Workspace.VeryDarkBox.KillerBoxCameraSurvivors.CFrame
12end)
13 
14Event2.OnClientEvent:Connect(function()
15    local KillerCamera = game.Workspace.CurrentCamera
View all 21 lines...

When i want event to fire it doesn't work (And also if you will find any errors in local script tell me )

0
First, CurrentCamera is a instance that you can just found with a LocalScript (ClientScript) and is same for «Players.LocalPlayer». You just can't found a client with a ServerScript(NormalScript). Basic error. NiniBlackJackQc 1562 — 5y
0
So what do i do ;-; kujekmarek 24 — 5y
0
Thank you so much! I put FireAllClients(plrs) and it worked! THANKS kujekmarek 24 — 5y
0
Put [SOLVED] In your title so people know this has been solved. killerbrenden 1537 — 5y

Answer this question