You can write your topic however you want, but you need to answer these questions:
-
**What do you want to achieve?
I want to complete this remote event function -
**What is the issue? It does not detect the event system but it is surely my mistake, I am still not very good at programming
-
**What solutions have you tried so far? I was watching several videos to find the solution but Idid not find
–localscript–
local remote = game:GetService("ReplicatedStorage")
local remote1 = remote:WaitForChild("RemoteEvent")
local Character = script.Parent
local UserInputService = game:GetService("UserInputService")
local Light = Instance.new("PointLight", Character:WaitForChild("RightHand"))
local Light1 = Instance.new("PointLight", Character:WaitForChild("RightHand"))
local player = game.Players.LocalPlayer
local Anim1 = script:WaitForChild("Animation")
local hum = player.Character:WaitForChild("Humanoid")
local play = hum.Animator:LoadAnimation(Anim1)
local hand = player.Character:WaitForChild("RightHand")
local aKeyPressed = false
Light.Color = Color3.fromRGB(255, 255, 255)
Light.Enabled = false
Light.Brightness = 1.9
Light.Range = 10
Light.Shadows = true
Light1.Color = Color3.fromRGB(255, 255, 255)
Light1.Enabled = false
Light1.Brightness = 0.5
Light1.Range = 15
Light1.Shadows = false
function onKeyPress(inputObject, gameProcessedEvent)
if not gameProcessedEvent then
if inputObject.KeyCode == Enum.KeyCode.F then
if Light.Enabled == false then
hand.CastShadow = false
hand.Material = Enum.Material.ForceField
play:Play()
play.Looped = true
Light.Enabled = true
Light1.Enabled = true
else
hand.Material = Enum.Material.Plastic
play:Stop()
play.Looped = false
Light1.Enabled = false
hand.CastShadow = true
Light.Enabled = false
end
end
end
end
UserInputService.InputBegan:Connect(onKeyPress)
remote1:FireServer(onKeyPress)
script
local remote = game:GetService("ReplicatedStorage")
local remote1 = remote:WaitForChild("RemoteEvent")
remote1.OnServerEvent:Connect(function(player, onKeyPress)
end)
texto en negrita