#Help pls

7 messages · Page 1 of 1 (latest)

formal ember
#

I don't know what I did wrong with my script please help

local Deploy = script.Parent
local DeploySet = script.Parent
local team = game.Players.LocalPlayer.Team
local part1 = game.Workspace.Team1Part
local part2 = game.Workspace.Team2Part

if inputObject.KeyCode == Enum.KeyCode.E then
        if team == "Allies" then
            game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = part1.CFrame
        elseif team == "Axis" then
            game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = part2.CFrame
        end
        
        Deploy.Visible = false
        DeploySet.Visible = false
    
    end

It's supposed to hide the UI and teleport the player to a certain part accordingly to the players team. I thought the script would work but apparently not.

teal sand
#

Well, just at first glance you have local Deploy and local DeploySet set to the same parent of the script

#

I believe that that script is way underdeveloped for what you want it to do. There's nothing in there that would cause a Player to teleport from what I see. All I'm seeing is a /possible/ though unverified toggle of the UI from Visible to not Visible.

You've called for Allies, but it's not defined. Same with Axis.

Disclaimer: I cannot and do not guarantee the accuracy of my observations as I am not a professional scripter. These are just things that appear to me to be an issue at first glance.

vast drift
vast drift
# formal ember I don't know what I did wrong with my script please help ```lua local Deploy = ...

1.) The path to "Deploy" is script.Parent

2.) But here in the code you state the path to "DeploySet" is script.Parent (which isn't, see 1.). The path to "DeploySet" from the script is, script.Parent.Parent

3.) Its not necessary to change the visibility of the child (Deploy) of DeploySet as it will be turn invisible when DeploySet is turn to invisible

4.) Also if am right LocalPlayer.Team should return an instance, which you tried to compare ''=='' with a string which will most likely gonna cause an error