#shoot is not a valid member of ReplicatedStorage "ReplicatedStorage"

1 messages · Page 1 of 1 (latest)

fallen stratus
#
local Gun = game.Workspace.Gun
local Shoot = game.ReplicatedStorage.shoot
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()

local cooldown = 1.5

local function onclick()
    if player.Character:FindFirstChildOfClass("Gun") then
        shoot:FireServer(mouse.Hit.p)
    end
end

Gun.Activated:Connect(onclick)
wait(cooldown)
obsidian depot
#

Gun isnt a class, so usew FindFirstChild + the wait(cooldown) wont do anything if ur tryna prevent spamming. Add cooldown logic in the function if you want that

fallen stratus
#

thank you!

#

i will go test it

obsidian depot
#

hmmm

#

What did the output say? + is it a local script

fallen stratus
#

yes

#

it is a local scirpt

#

and outpout is the same as the title of the

#

post?

#

yeah post

obsidian depot
#

ok then

#

maybe say this? local Shoot = game.ReplicatedStorage:WaitForChild("Shoot")

fallen stratus
#

oh

#

the error doenst pop anymore

#

Thank you very much!

obsidian depot
#

yw

#

ig close it

deep lion