im a little new to scripting but why doesn't this fire?
localscript
local proxy = script.Parent.ProximityPrompt local event = game:GetService("ServerStorage"):WaitForChild("HasCrowbar") if event.OnClientEvent then proxy.Enabled = true end event.OnClientEvent:Connect(oneventFired)
here's the other side of the code
script
local promt = script.Parent local original = game:GetService("ReplicatedStorage"):WaitForChild("Crowbar") local event = game:GetService("ServerStorage"):WaitForChild("HasCrowbar") local spots = script.Parent.Parent.Parent promt.TriggerEnded:Connect(function(player) local new = original:Clone() new.Parent = player.Backpack print("player has crowbar") event:FireClient(player) wait(0.2) spots:Destroy() end)
I cooked up a new script for you!
The problem is you can't check if the event has been fired, you have no function so the OnClientEvent will not fire which will bring you an error of no function found
If the script works, I'd appreciate it a lot if you accept my answer!
Here's your script, It must be a Local Script
local proxy = script.Parent.ProximityPrompt local hasCrowbarRE = game:GetService("ServerStorage"):WaitForChild("HasCrowbar") hasCrowbarRE.OnClientEvent:Connect(function() proxy.Enabled = true end)
You can't access ServerStorage on the client. It can only be used by server scripts. Try placing the event in ReplicatedStorage
local proxy = script.Parent.ProximityPrompt local event = game:GetService("ReplicatedStorage"):WaitForChild("HasCrowbar") -- Change if you want event.OnClientEvent:Connect(function() proxy.Enabled = true end)
You would also change the location reference in the Server script
local promt = script.Parent local original = game:GetService("ReplicatedStorage"):WaitForChild("Crowbar") local event = game:GetService("ReplicatedStorage"):WaitForChild("HasCrowbar") -- Change if you want local spots = script.Parent.Parent.Parent promt.TriggerEnded:Connect(function(player) local new = original:Clone() new.Parent = player.Backpack print("player has crowbar") event:FireClient(player) wait(0.2) spots:Destroy() end)
hey you! have you ever heard of enes? if you are in trouble, better call enes!