What do you want to achieve?
Im Trying To Make It So It Fires Remote Event From Server To Client
What is the issue?
It Doesn’t Take The Input From The Event No Matter What
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.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)
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
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)