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

Can somebody help me with ClickDetector?

Asked by 8 years ago

So I'm currently working on this NPC for a game that will fire an event when I left-click his head (ClickDetector). For the function 'onClicked' I will execute a placeholder script to print out an output saying 'Head clicked'. The workspace hierarchy for this part of the map is like this :

(Workspace)Workspace
    (Part)Head
        (SpecialMesh)Mesh
        (Script)OnClickShopScript
        (ClickDetector)ShopClick
        (Decal)Decal

The script in 'OnClickShopScript' is like this :

function onClicked(player)
    print("Head clicked")
end

script.Parent.ShopClick.MouseClick:connect(onClicked)

On Offline Play Simulation mode this script works out fine. The output is like this after clicking the shopkeeper's head thrice :

Loaded gloo library. Type _G.gloo.Help() for help.
Loaded CmdUtl plugin (v5.0.0)
Head clicked
Head clicked
Head clicked
13:49:13.006 - Auto-Saving...

Upon launching a one player test server, problems arise. This is server output :

13:53:32.037 - Started network server on XXXXXXXX
13:53:32.038 - Started network server on XXXXXXXX
Loaded gloo library. Type _G.gloo.Help() for help.
Loaded CmdUtl plugin (v5.0.0)
13:53:32.445 - Successfully opened file - C:/Users/User/AppData/Local/Roblox/server.rbxl
13:53:38.367 - New connection from XXXXXXXX

13:53:38.436 - Replication: Can't create default object of type Players
Player -1 added

This is client output :

Loaded gloo library. Type _G.gloo.Help() for help.
Loaded CmdUtl plugin (v5.0.0)
13:53:38.407 - ! Joining game '' place 0 at localhost
13:53:38.409 - Connecting to localhost:XXXXXXXX
13:53:38.451 - Connection accepted from XXXXXXXX

Playing as a client, clicking the shopkeeper's head does absolutely nothing to either server or client outputs.

Please help, I want this to work online too.

0
Is FilteringEnabled on? Is the script just a normal Script object? User#6546 35 — 8y
0
Yes, I turned FilteringEnabled on. The script is also a normal Script. squareHEADnoob 5 — 8y
0
kek a free ip GullibleChapV2 155 — 8y
0
Censored all IPs and Ports. Thanks for the warning squareHEADnoob 5 — 8y
View all comments (2 more)
0
Apparently disabling FilteringEnabled fixes this problem. However, I want my game to have FilteringEnabled on, what should I do instead? squareHEADnoob 5 — 8y
0
I'm not sure. It's such a simple script, and I don't believe it interferes with FE. Shawnyg 4330 — 8y

Answer this question