How do I make this server side instead of client side? [closed]
Asked by
4 years ago Edited 4 years ago
Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
01 | local gui = script.Parent |
02 | local players = game:GetService( "Players" ) |
03 | local player = players.LocalPlayer |
04 | local run = game:GetService( "RunService" ) |
05 | local sound = script.KillSound |
08 | gui.KillButton.MouseButton 1 Click:Connect( function () |
09 | local character = player.Character |
10 | if not character then return end |
11 | local head = character:FindFirstChild( "Head" ) |
12 | if not head then return end |
13 | for _, v in pairs (workspace:GetChildren()) do |
14 | if v:IsA( "Model" ) and v:FindFirstChild( "Humanoid" ) and v:FindFirstChild( "Head" ) and v ~ = character then |
16 | if (character.Head.Position - v.Head.Position).Magnitude < = 20 and v.Humanoid.Health > 0 and script.Parent.KillButton.Timer.Visible = = false then |
19 | character:MoveTo(v.HumanoidRootPart.Position) |
20 | script.Parent.KillButton.Timer.Visible = true |
22 | script.Parent.KillButton.Timer.Text = "9" |
24 | script.Parent.KillButton.Timer.Text = "8" |
26 | script.Parent.KillButton.Timer.Text = "7" |
28 | script.Parent.KillButton.Timer.Text = "6" |
30 | script.Parent.KillButton.Timer.Text = "5" |
32 | script.Parent.KillButton.Timer.Text = "4" |
34 | script.Parent.KillButton.Timer.Text = "3" |
36 | script.Parent.KillButton.Timer.Text = "2" |
38 | script.Parent.KillButton.Timer.Text = "1" |
40 | script.Parent.KillButton.Timer.Visible = false |
47 | run.Heartbeat:Connect( function () |
48 | local character = player.Character |
49 | if not character then return end |
50 | local head = character:FindFirstChild( "Head" ) |
51 | if not head then return end |
53 | for _, v in pairs (workspace:GetChildren()) do |
54 | if v:IsA( "Model" ) and v:FindFirstChild( "Humanoid" ) and v:FindFirstChild( "Head" ) and v ~ = character then |
56 | if (character.Head.Position - v.Head.Position).Magnitude < = 20 and v.Humanoid.Health > 0 and script.Parent.KillButton.Timer.Visible = = false then cankill = true end |
60 | gui.KillButton.ImageTransparency = 0 |
62 | gui.KillButton.ImageTransparency = 0.65 |
Edit By JesseSong:
Please do not use deceitful means to get users to do your request. If you want to pay people to help you with your code you should make a portfolio in the Roblox Developer forums.
Make sure your question is paraphrased with a sentence explaining what is wrong and not working with the code.
You can click on the hyperlink provided