I've been trying to make this server sided but I'm unable to do so I've tried for about an hour or two trying to fix this..
01 | local Debounce = false |
02 | local MultDiv = 5 |
03 | script.Parent.Touched:connect( function (hit) |
04 | if hit.Parent:FindFirstChild( "Humanoid" ) and not Debounce then |
05 | local hum = hit.Parent:WaitForChild( "Humanoid" ) |
06 |
07 | game.ReplicatedStorage.ScreenGui:Clone().Parent = game.Localplayer.plr.PlayerGui |
08 | hum:remove() |
09 | Debounce = true |
10 | wait( 3 ) |
11 | print ( "Scumbag named " + Localplayer.Name + "was removed." ) |
12 | Debounce = false |
13 | end |
14 | end ) |
You can't use LocalPlayer
in a server script, do this:
01 | local Debounce = false |
02 | local MultDiv = 5 |
03 | script.Parent.Touched:connect( function (hit) |
04 | if hit.Parent:FindFirstChild( "Humanoid" ) and not Debounce then |
05 | local hum = hit.Parent:WaitForChild( "Humanoid" ) |
06 | local plr = game.Players:GetPlayerFromCharacter(hit.Parent) |
07 | game.ReplicatedStorage.ScreenGui:Clone().Parent = plr.PlayerGui |
08 | hum:remove() |
09 | Debounce = true |
10 | wait( 3 ) |
11 | print ( "Scumbag named " + plr.Name + "was removed." ) |
12 | Debounce = false |
13 | end |
14 | end ) |
Hm, I don't get what you're trying to do here.
I believe you're going to be using a standard script for this code, I don't know why you want to convert it to FilteringEnabled.
And if that's not what you're trying to do here's the definition of Server-Sided script:
Script that runs on the server instead of the client, often used in Roblox to prevent any unauthorized changes made by the client when used in FilteringEnabled.