local tool = script.Parent local detector = script.Parent.Handle.ClickDetector local function pickup(player) script.Parent.Pickup:Play() tool.Handle.Anchored = false tool.Name = "Crowbar" tool.Parent = game.Workspace[player.Name] game.Workspace.BasementDoor.DoorBasement.ProximityPrompt.Enabled = true game.ReplicatedStorage.CrowbarText:FireClient(player) print("test 1") end detector.MouseClick:Connect(pickup)
different scripts
local textlabel = script.Parent:WaitForChild("TextLabel") local function typewriter(object,text) for i = 1,#text,1 do object.Text = string.sub(text,1,i) wait(0.06) end end repeat wait(0.01) until game:IsLoaded() wait(40) typewriter(textlabel,"I don't have a good feeling about this place...") wait(10) textlabel.Text = "" game.ReplicatedStorage.CrowbarText.OnClientEvent:Connect(function(player) print("working") end)
Remote events works between client sided scripts and server sided scripts. Using a remote for the client sided script to anotherclient sided will print nil. Try use server script instead.
To use an Event to pass arguments between two clients, you'll have to make use of a BindableEvent
. Replace FireClient
with Fire
and OnClientEvent
with Event
.