I am hopeless when it comes to complicated stuff like this so i would like some help.
I would like to make it so when i hit or tap someone with this object it kicks them from my game, i would like to know if anyone knows how to code any of this stuff so i can make it. I would also like to know if i need to make a code where will i put it? Into the object and make a script? Could someone please help?
Here:
script.Parent.Touched:Connect(function(person) local hum = person.Parent:FindFirstChild("Humanoid") if hum then local plr = game.Players:GetPlayerFromCharacter(person.Parent) plr:Kick("Put the kicked message here") end end)
Put this inside the part you want the player to touch that kicks them.
This might help:
local players = game:GetService("Players") --Gets the player service local LocalPlayer = players.LocalPlayer -- Finds the player local part = --Define where the part that needs to be touched is repeat wait() until LocalPlayer.Character -- Waits until a player joins the game local function kick() -- Defines what happens when the function is fired LocalPlayer:Kick("Exploiting") -- Kicks the player. You can write your own reason for kicking end part.Touched:Connect(kick) --Fires the function above when the part is touched.
Hopefully it helped!