So here is my Script using .Touched and .KeyDown .
function debounce(func) local isRunning = false return function(...) if not isRunning then isRunning = true func(...) isRunning = false end end end script.Parent.Touched:connect(debounce(function(player) if player.Parent and game.Players:GetPlayerFromCharacter(player.Parent) then plr = game.Players:GetPlayerFromCharacter(player.Parent) print("Work1") mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) if key:lower() == "r" then print("Work2") game.Workspace.Int.Value = true end end) end end))
So as you see, when the player touch's the brick, it is supposed to print "Work1". This works fine in Play Solo, but will not print using Start Server. Why does this not work? All help appreciated, Thank You. ~ Xduel
Join the game in online mode and press F9 to open the developer console. Are there any errors?
Edit: The GetMouse function only works via LocalScript. You will have to listen for collisions client-side. Here's a quote from the wiki page:
Local: This item should be used with a LocalScript in order to work as expected in online mode.