Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

[SOLVED] Why doesnt this get mouse detection for serverside?

Asked by 2 years ago
Edited by Xapelize 2 years ago

Local Script

local rep = game.ReplicatedStorage
local mouseDetection = rep.MouseDetection
local player = game.Players.LocalPlayer
local mouse = game.Players.LocalPlayer:GetMouse()

mouse.Button1Down:Connect(function()
    mouseDetection:FireSever()
end)

Server Script

local rep = game:GetService("ReplicatedStorage")
local mouseDetection = rep:WaitForChild("MouseDetection")
local canHit = false
local db = false
local notMoving = false
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouseDetection.OnServerevent:Connect(function(player)
    canHit = true
    print(canHit)
end)

it gives this error: FireSever is not a valid member of RemoteEvent "ReplicatedStorage.MouseDetection"

0
did you mean OnServerEvent not OnServerevent, not sure if that's the problem Xapelize 2658 — 2y
0
alos delete the line 6 and line 7 on Server Script since it's for LocalScripts only Xapelize 2658 — 2y
0
nevermind i spelt server wrong i hate my life thecoolguy436 38 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Spelt Sever instead of server

Ad

Answer this question