✓ Accepted answer
Hello. You have to use RemoteEvents. They are used for client (player) and server communication. First, insert a RemoteEvent in ReplicatedStorage and call it "BoolTrueEvent". Now the part of your LocalScript to this:
elseif game.ReplicatedStorage.ClockTimeValue.Value ~= 6 and game.ReplicatedStorage.Stig.Value == true then
game.Lighting.StigForeverJumpScare.Parent = game.Workspace
game.ReplicatedStorage.BoolTrueEvent:FireServer()
print("time for jumpscare")
This will fire the RemoteEvent for the server. Now, insert a Script into ServerScriptService or Workspace. Write the following code:
game.ReplicatedStorage:WaitForChild("BoolTrueEvent").OnServerEvent:Connect(function(player)
game.ReplicatedStorage.JumpscareTime.Value = true
end)
The event will fire whenever the "BoolTrueEvent" fires, which it did in the LocalScript. Also, you automatically get the player who fired that event as a parameter of the OnServerEvent event. Please upvote and accept this answer if it helped.
1 comment
Thanks!