Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix this script broken by FE? The wiki pages don't help me, I dont get it.

Asked by 7 years ago

So, in my game, multiple scripts have been broken by enabling FE, and it is needed so our game can actually be seen by accounts under 13.

I need guidance on how I can fix these scripts, any help would be greatly appriciated.

For example, the handcuffs, script:

script.Parent.Equipped:connect(function(m)
m.Button1Down:connect(function()
if m.Target~=nil then
print(m.Target:GetFullName())
p=nil
_,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
print(p)
print(m.Target.Parent.Name)
if p~=nil then
local detained=p
coroutine.wrap(function()
        local c=p
        while p==c do wait() pcall(function()
                p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
        end) end
        print('END OF DETAIN LOOP')
        pcall(function() c.Character.Torso.Anchored=false end)
end)()
else print('no p') end
end
end)
end)

If someone could help me on how to get this script fixed, that would be wonderful.

1 answer

Log in to vote
0
Answered by 7 years ago

Make sure you've read:

It is better to help you understand what they mean rather than trying to fix all your scripts for you.

To apply this to a script, you need to think of what needs to happen on the client and what needs to happen on the server.

Things the client must do:

  • User input
  • GUI

Things the server must do:

  • Change properties of blocks/models/etc
  • Create new things

So you separate your script into these two roles (ex the first 2 lines of your script both deal with user input). When you need the client to communicate with the server (or vice versa), use Remote Events/Functions. In this case, you should have the client tell the server that the player wishes to handcuff some player (since the server won't know what m.Target is). If you want to be completely safe from hacking, the server should also make sure that m.Target is a player and that their character both exists and is fairly close to the person doing the handcuffing.

Ad

Answer this question