So Im Trying To Make A Vampire Script it detects a touch but it doesnt see a playergui inside of the player so i cannot set their vampire script to enabled
Here is the script
local player = game.Players.LocalPlayer
local character = player.Character
local enable = true
game.Workspace.VampireCount.Value = workspace.VampireCount.Value + 1
character.HumanoidRootPart.Touched:connect(function(hit)
if enable == true then
if hit.Parent:FindFirstChild("Humanoid") then
enable = false
if game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui.Vampire.Disabled == true then -- this is the part that wont work, the ouput says PlayerGui Is Not A Valid Member Of Player And I am testing this in a server test mode in roblox studio to let you know, because that might be the problem
repeat
wait(.1)
character.Humanoid.WalkSpeed = 0
hit.Parent.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=518246383"
hit.Parent.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=518246383"
hit.Parent.Humanoid.WalkSpeed = 0
character.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=518240717"
character.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=518240717"
wait(3)
hit.Parent.Humanoid:TakeDamage(14)
until hit.Parent.Humanoid.Health == 0
wait(1)
enable = true
character.Humanoid.WalkSpeed = 16
character.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=180435571"
character.Animate.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=180435792"
end
end
end
end)

1 comment
Didnt help