So my goal is to use this script to make it so that when you click on a button, an event is fired. That event could make a bunch of options happen. Here is the script: Local script in gui:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local event = ReplicatedStorage:WaitForChild("RemoteEvent") script.Parent.MouseButton1Down:connect(function(billnye) script.Parent.Parent.Person.Value = script.Parent.Parent.b.Text script.Parent.Parent.Parent.yesgui.a.Visible = false script.Parent.Parent.Parent.yesgui.b.Visible = false script.Parent.Parent.Parent.yesgui.c.Visible = false script.Parent.Parent.Parent.yesgui.d.Visible = false event:FireServer(script.Parent.Parent.Parent.Attack.ScrollingFrame.AttackDone.Value, game.Workspace:FindFirstChild(game.StarterGui.yesgui.Person.Value), game.Players:FindFirstChild(game.StarterGui.yesgui.Person.Value)) end)
The variables are values that define what you want to happen to other players, one also has the player name that they want to attack.
ServerScriptService script:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local event = ReplicatedStorage:WaitForChild("RemoteEvent") local function yesgogo(attack, playerokay, playerokayplay) if attack == "Kill" then playerokay.Humanoid.Health = 0 end if attack == "Speed" then playerokay.Humanoid.WalkSpeed = 100 end if attack == "Slow" then playerokay.Humanoid.WalkSpeed = 3 end if attack == "Jail" then local jailCopy = game.Workspace.AdminAssets.Jail:Clone() jailCopy.Parent = game.Workspace jailCopy.Transparency = 0 jailCopy.CanCollide = true jailCopy.Position = Vector3.new(playerokay.HumanoidRootPart.Position.X, playerokay.HumanoidRootPart.Position.Y, playerokay.HumanoidRootPart.Position.Z) end if attack == "LevelOP" then playerokayplay.leaderstats.Level.Value = 100 end if attack == "Reset" then playerokayplay.leaderstats.Level.Value = 1 end end event.OnServerEvent:Connect(yesgogo)
I don't know why these don't effect the player. Please help. Thank you.