I am trying to use a remote event from a client to a server. Below are my two scripts which are both below an image button:
- client
local Players = game:GetService("Players")
plr = game:GetService("Players").LocalPlayer
char = plr.Character or plr.CharacterAdded:Wait()
print("hekki")
script.Parent.MouseButton1Click:Connect(function()
print("hello!")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local destroyToolEvent = ReplicatedStorage:WaitForChild("DestroyToolEvent")
local tool = char:FindFirstChildOfClass("Tool")
destroyToolEvent:FireServer(tool)
end)
- server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local destroyToolEvent = Instance.new("RemoteEvent", ReplicatedStorage)
destroyToolEvent.Name = "DestroyToolEvent"
local function onCreatePartFired(player, tool)
local SG = player.StarterGear
if tool then
print("hello!!!")
tool:Destroy()
end
if SG:FindFirstChild(tool.Name) then
SG[tool.Name]:Destroy()
end
end
destroyToolEvent.OnServerEvent:Connect(onCreatePartFired)
When I run "hekki" is printed and "hello!" is printed every time i press the button. However, "hello!!!" is never printed. What's the issue?

2 comments
https://developer.roblox.com/en-us/api-reference/class/RemoteEvent check this out
https://gyazo.com/77f9facca200a6fdbcca1f326831e88c i dont see any error tho