What do you want to achieve? My Remote Event script that enables a gui and unlocks the mouse to run. (game is in first person)
What is the issue? When I click the part that triggers the script to FireServer(), nothing happens. (Issue recorded on mobile because my computer’s recorder isn’t the best quality.)
What solutions have you tried so far? Changing my scripts and looking on the DevForum
Local Script in part that you click
local Event = game.ReplicatedStorage.DrawerEvent
local ClickDetector = game.Workspace.Map.House.Cabinet.Drawer.DrawerNote.ClickDetector
ClickDetector.MouseClick:Connect(function()
local InputService = game:GetService("UserInputService")
InputService.MouseBehavior = Enum.MouseBehavior.Default
Event:FireServer()
end)
Script In ServerScriptService
local Event = game.ReplicatedStorage.DrawerEvent
local Detector = game.Workspace.Map.House.Cabinet.Drawer.DrawerNote.ClickDetector
local Note = game.Workspace.Map.House.Cabinet.Drawer.DrawerNote
Event.OnServerEvent:Connect(function(plr)
local Gui = plr.PlayerGui:WaitForChild("DrawerPage")
Note.Transparency = 1
Gui.Enabled = true
end)
its because your localscript is probably in workspace.
and localscripts doesn’t run in workspace.
you can put the localscript in StarterCharacterScripts