GUI's won't show

Ok! But one problem. My script isn’t in the tool it’s in StarterCharacterScripts as a server script.

try putting it in the tool see if it will work

Everything in the script was scripted around it being inside of StarterCharacterScripts.

I dont see much change when adding the script inside the tool, all you gotta do is change up the variables (I may be wrong)
Try adding the char you mentioned at the top of the script inside of O:FireClient().

O:FireClient(char)

Ok, So this may work, but it comes up with this error: FireClient: player argument must be a Player object
My code:

local ToolHolder = part.Parent.Parent.Parent
O:FireClient(game.Players:GetPlayerFromCharacter(ToolHolder))

you added an extra parent in the variable, the game thinks your mentioning workspace. Remove that extra parent and see if it will work

local Tool = part.Parent.Parent
local ToolHolder = game.Players:GetPlayersFromCharacter(Tool)

-- and then
O:FireClient(ToolHolder)

Still no difference. Comes up with the same error message every time.

Where is the script placed inside of and what type of script is it?

it is a server script inside of StarterCharacterScripts.

@MRBOGO_YT just try putting the script inside of your tool, and replace everything with this full code:

local Tool = script.Parent
local Handle = Tool.Handle

local character = Tool.Parent
local ToolHolder = game.Players:GetPlayersFromCharacter(character)
   -- Remote Events
local R = game:GetService("ReplicatedStorage").R
local I = game:GetService("ReplicatedStorage").I
local O = game:GetService("ReplicatedStorage").O

Handle.Touched:Connect(function(hit)

   if not hit.Parent:FindFirstChild("Humanoid") then -- if humanoid does not exist
      return
   end
   -- Variables 
   local targetChar = hit.Parent
   local targetPlr = game.Players:GetPlayersFromCharacter(targetChar)
   local hum = hit.Parent:WaitForChild("Humanoid")
   local animationTrack = hum.Animator:LoadAnimation(script.Animation)
   
   if targetPlr then
      animationTrack:Play()
      print("Animation Track has started")
   
      O:FireClient(ToolHolder)
      print("Gui should be visible now")
   end

   I.OnServerEvent:Connect(function()
      print("Server successfully fired for Event I")
      targetChar.Torso.CFrame = CFrame.new(0.5, 4.65, 29.5) -- Where the prisoner is going to teleport
      wait(1)
      targetChar.Torso.CFrame = CFrame.new(-0.75, 5.5, -0.75)
   end)
   
   R.OnServerEvent:Connect(function()
      print("Server successfully fired for Event R")
      animationTrack:Stop()
   end)
end)

This should work

Didn’t change anything. The same error the same outcome.

the error Player Argument must be a Player Object? And you put script inside tool right?

Yep. And I don’t know why. There must be a way.

Weird. There is no way the code couldnt have worked. Maybe you placed the script in the wrong place (placed it in the handle of the tool), or made a code mistake. Show the code that is in the script currently

Here is a picture of the explorer and code:

I dont see anything wrong, I am so confused…

1 Like

Im going to try testing this myself in some time, ill reply back when Im done testing

Does anyone know anyone who might know how to do this or what the problem is?

Wait… Oops. I didn’t disable the other script! Now it does not come up with the error but does not play the animation or show the GUI’s.

Ok I tested this myself and it did actually work. I tested this with an NPC, but im pretty sure this will work with actual players too. Are you testing this with a player or an NPC?