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

Clone in item and attach it to player, help?

Asked by 6 years ago
Fout = 2
Flag = game.ServerStorage.Flag
Giver = game.Workspace.FlagGiver

function giveFlag(part)
local parent = part.parent
    if game.Players:GetPlayerFromCharacter(parent) and Fout == 2 then
        local OPFlag = Flag:Clone()
        OPFlag.Parent = workspace
        OPFlag.Position = -- What I need help on.
        Fout = 1
    end
end

Giver.Touched:connect(giveFlag)

I'm planning to connect the item to the player with a weld once it's been spawned in, though if anyone has a better pay of doing that it'd also be greatly appreciated, but the main part is getting is to spawn in at the players position, help please?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I HOPE THIS HELPS!!!! :


Fout = 2 local Flag = game.ServerStorage.Flag -- i would use a local JIC local Giver = game.Workspace.FlagGiver local Position = Character.HumanoidRootPart.Position function giveFlag(part) local parent = part.parent if game.Players:GetPlayerFromCharacter(parent) and Fout == 2 then local OPFlag = Flag:Clone() OPFlag.Parent = workspace OPFlag.Position = Position -- What I dont need help on anymore Fout = 1 end end Giver.Touched:connect(giveFlag)
0
Studio doesn't understand what's meant by Character. JackMills 0 — 6y
0
Try using the torso pposition(so like game.workspace.player(i forgot what it is, its somthing like player but probebly mess aroud with the word player).Torso fireburnpokemon 16 — 6y
Ad

Answer this question