I’m trying to make each function work, but nothing happens. I’m very confused. This is done in a LocalScript
local plr = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local Camera = game:GetService("Workspace").CurrentCamera
local Changer = script.Parent.Changer
local function CutsceneStarts()
UIS.MouseIconEnabled = true
Changer.Modal = true
print("fin :D")
end
local function CutsceneEnds()
UIS.MouseIconEnabled = false
Changer.Modal = false
print("fin :D")
end
game:GetService("Players").PlayerAdded:Connect(CutsceneStarts)
Think of it like this. Since this is a local script, it is probably located in the player (whether that be the player instance itself or their character). Since it is located inside the player and you add a "PlayerAdded" event inside this script after the player is already created, nothing will happen. If you’re wanting the function to run as soon as the player is created, you can just:
local plr = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local Camera = game:GetService("Workspace").CurrentCamera
local Changer = script.Parent.Changer
local function CutsceneStarts()
UIS.MouseIconEnabled = true
Changer.Modal = true
print("fin :D")
end
local function CutsceneEnds()
UIS.MouseIconEnabled = false
Changer.Modal = false
print("fin :D")
end
CutsceneStarts()