--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
You are mixing up client/server sided elements. Here is my attempt in fixing your code:
--localscript local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent") Mouse.Button1Down:connect(function() 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 Trangle = Foreign.Torso:FindFirstChild("Attachment") if Trangle == nil then local Foreign = Mouse.Target.Parent RemoteEvent:FireServer(Foreign) end end end) end end)
--script local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = Instance.new("RemoteEvent", ReplicatedStorage) RemoteEvent.Name = "RemoteEvent" local function RemoteFired(player,Foreign) local Character = player.Character 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 RemoteEvent.OnServerEvent:Connect(RemoteFired)
Let me know if there is some issues haven't tested yet! Put the script into ServerScriptService. Put the localscript into ReplicatedFirst or wherever as long as it will be executed there.