How To Make Client Take OutPut From Server Ussing Remote Event

  1. What do you want to achieve?
    Im Trying To Make It So It Fires Remote Event From Server To Client
  2. What is the issue?
    It Doesn’t Take The Input From The Event No Matter What
  3. What solutions have you tried so far?
    Tried Firing It To All Client Ussing Bindable Event Looking At Dev Forum Looking At The Thing About Remote Events

Script

script.Parent.ClickDetector.MouseHoverEnter:Connect(function(player)
	script.Parent.Shake:FireClient(player)	
end)

Local Script


script.Parent.Shake.OnClientEvent:Connect(function(player)
	print("Fired")
	local character = player.Character

for i = 1,20 do
		

	
	
	local x = math.random(-100,100)/100
	local y = math.random(-100,100)/100	
	local z = math.random(-100,100)/100
	character.Humanoid.CameraOffset = Vector3.new(x,y,z)

	


	wait()
end
	character.Humanoid.CameraOffset = Vector3.new(0,0,0)
	end)
script.Parent.ClickDetector.MouseHoverEnter:Connect(function(player)
	script.Parent.Shake:FireClient(player)	
end)

Is that a tool by any chance?

no its a part which works perfectly fine as it fires the event it just the local script part ain’t working for some reason

Local scripts have to be under the player’s Character or Player object to run. You have to place the local script in StarterPlayerScripts or StarterCharacterScripts (and several others) for it to work. That also means that you will have to pass the BasePart to the client through the remote event

3 Likes

i made script

script.Parent.ClickDetector.MouseHoverEnter:Connect(function(player)
game.ReplicatedStorage.Shake:FireClient(player)	
	
end)

and placed local script in starterplayerscripts
and made local script this

game.ReplicatedStorage.Shake.OnClientEvent:Connect(function(player)
	print("Fired")
	local character = player.Character
for i = 1,20 do
	local x = math.random(-100,100)/100
	local y = math.random(-100,100)/100	
	local z = math.random(-100,100)/100
	character.Humanoid.CameraOffset = Vector3.new(x,y,z)
	wait()
end
	character.Humanoid.CameraOffset = Vector3.new(0,0,0)
	end)

and it did not seem to change anything

1 Like

thanks it actualy worked i found out that i forgot to write the event itself