--localscript
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local event = script.Parent:WaitForChild("RemoteEvent")
Mouse.Button1Down:connect(function()
event.OnClientEvent:connect(function(player, arguments)
if arguments == true then
elseif arguments == false then
if Mouse.Target ~= nil then
Mouse.Target.Parent:FindFirstChild("Humanoid")
if Mouse.Target.Parent.Humanoid == nil then
print("you failed...")
end
spawn(function()
if Mouse.Target.Parent.Humanoid ~= nil then
local Foreign = Mouse.Target.Parent
local Character = Player.Character
local Trangle = Foreign.Torso:FindFirstChild("Attachment")
if Trangle == nil then
local Link = Instance.new ("Attachment")
Link.Parent = Foreign.Torso
Character.Arm1.ControlStone.Beam.Attachment1 = Foreign.Torso.Attachment
Character.Arm1.ControlStone.Attachment.Shine.Enabled = true
local anim = Character.Humanoid:LoadAnimation(script:FindFirstChild("Animation"))
anim:Play()
wait(1)
local gradual = 140 -- Smoothness of transition. May be performance hungry but idk.
local waittime = 0.006 -- Speed of transition. Slower at high values and faster at lower values.
for i = 1, gradual do
wait(waittime)
local numseq = {NumberSequenceKeypoint.new(0,i/gradual),NumberSequenceKeypoint.new(1,i/gradual)}
local NS = NumberSequence.new(numseq)
Character.Arm1.ControlStone.Beam.Transparency = NS
end
event:FireServer()
end
end
end)
end
end
end)
end)
--script
script.Parent.RemoteEvent.OnServerEvent:connect(function(player, arguments)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
if Mouse.Target ~= nil then
Mouse.Target.Parent:FindFirstChild("Humanoid")
if Mouse.Target.Parent.Humanoid == nil then
print("you failed...")
end
spawn(function()
if Mouse.Target.Parent.Humanoid ~= nil then
local Foreign = Mouse.Target.Parent
local Character = Player.Character
local Trangle = Foreign.Torso:FindFirstChild("Attachment")
if Trangle == nil then
local Link = Instance.new ("Attachment")
Link.Parent = Foreign.Torso
Character.Arm1.ControlStone.Beam.Attachment1 = Foreign.Torso.Attachment
Character.Arm1.ControlStone.Attachment.Shine.Enabled = true
local anim = Character.Humanoid:LoadAnimation(script:FindFirstChild("Animation"))
anim:Play()
wait(1)
local gradual = 140 -- Smoothness of transition. May be performance hungry but idk.
local waittime = 0.006 -- Speed of transition. Slower at high values and faster at lower values.
for i = 1, gradual do
wait(waittime)
local numseq = {NumberSequenceKeypoint.new(0,i/gradual),NumberSequenceKeypoint.new(1,i/gradual)}
local NS = NumberSequence.new(numseq)
Character.Arm1.ControlStone.Beam.Transparency = NS
end
end
end
end)
end
end)
i cant solve what i'm doing wrong so if theres anyone out there that can help me or give me something that would solve this please send it. it doesnt even tell me when I press F9

3 comments
Hey hop in the chat I might have your solution.
this chat?
Seems I'm having the same problem with my rocket launcher. Although looking at the code, you can't get a local player from your server script as it can only be done in a local script. This could be the cause?